Bugzilla – Attachment 192180 Details for
Bug 152524
macOS: LibreOffice crashes (gpgme / gpgmeio) on macOS 13 Ventura
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Debug patch that tracks number of classes loaded before and after gpgme forks a new process
debug_patch.txt (text/plain), 2.18 KB, created by
Patrick Luby (volunteer)
on 2024-01-26 14:26:20 UTC
(
hide
)
Description:
Debug patch that tracks number of classes loaded before and after gpgme forks a new process
Filename:
MIME Type:
Creator:
Patrick Luby (volunteer)
Created:
2024-01-26 14:26:20 UTC
Size:
2.18 KB
patch
obsolete
>diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk >index 4a616cf18deb..fff75f1f3a97 100644 >--- a/xmlsecurity/Library_xsec_xmlsec.mk >+++ b/xmlsecurity/Library_xsec_xmlsec.mk >@@ -183,6 +183,11 @@ $(eval $(call gb_Library_add_libs,xsec_xmlsec,\ > -ldl \ > )) > endif >+ifeq ($(OS),MACOSX) >+$(eval $(call gb_Library_add_libs,xsec_xmlsec,\ >+ -lobjc \ >+)) >+endif > > endif # !$(OS),WNT > >diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx >index e6813228a457..72b2449d203c 100644 >--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx >+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx >@@ -39,6 +39,9 @@ > #endif > #include <context.h> > >+#include <map> >+#include <objc/objc-runtime.h> >+ > using namespace css; > using namespace css::security; > using namespace css::uno; >@@ -76,7 +79,38 @@ SecurityEnvironmentGpg::SecurityEnvironmentGpg() > return true; > }(); > #endif >+static int nPreviousClassCount = 0; >+static std::map<const char *, const char *> aLoadedClasses; >+int nClassCount = objc_getClassList(NULL, 0); >+fprintf(stderr, "Before: %i\n", nClassCount); >+if (nPreviousClassCount < nClassCount) >+{ >+ Class classes[nClassCount]; >+ nClassCount = objc_getClassList(classes, nClassCount); >+ if (nPreviousClassCount < nClassCount) >+ { >+ for (int i = 0; i < nClassCount; i++) >+ { >+ Class c = classes[i]; >+ const char *className = class_getName(c); >+ if (className) >+ { >+ std::map<const char *, const char *>::const_iterator it = aLoadedClasses.find(className); >+ if (it == aLoadedClasses.end()) >+ { >+ fprintf(stderr, "Class added: %s\n", className); >+ aLoadedClasses[className] = className; >+ } >+ } >+ } >+ >+ nPreviousClassCount = aLoadedClasses.size(); >+ } >+ >+ nPreviousClassCount = nClassCount; >+} > GpgME::Error err = GpgME::checkEngine(GpgME::OpenPGP); >+fprintf(stderr, "After: %i\n", objc_getClassList(NULL, 0)); > if (err) > throw RuntimeException("The GpgME library failed to initialize for the OpenPGP protocol."); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 152524
:
191576
| 192180 |
192922
|
192948
|
192949