summaryrefslogtreecommitdiffstats
path: root/liblangtag
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-20 15:40:30 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-20 17:17:23 +0000
commitc63f4962caefc22cbf0fa9cde87f3a49d79f0b85 (patch)
treeeb1c43b900774f1bff46da235fad114eef9c7085 /liblangtag
parentAdd RPATH to liblangtag (diff)
downloadcore-c63f4962caefc22cbf0fa9cde87f3a49d79f0b85.tar.gz
core-c63f4962caefc22cbf0fa9cde87f3a49d79f0b85.zip
Do not call xmlCleanupParser from liblangtag
Despite its name, it is a cleanup function for libxml2 that must only be called when the process as a whole no longer needs libxml2. Calling it from a library like liblangtag is not appropriate (just like liblangtag does not call xmlInitParser, either). In LibreOffice, this caused confusion about pthread keys for thread-local storage (xmlCleanupParser calls pthread_key_delete, but apparently if libxml2 is later used by unrelated code in LibreOffice again, it still uses the stale key, and if that key is now reused via an unrelated pthread_key_create, arbitrary crashes happen during thread termination in pthread's __nptl_deallocate_tsd). (cherry picked from commit 5e6c595e9d698caf23ae68d38b9cab30ff9c9b94) Conflicts: liblangtag/makefile.mk Change-Id: I82cef8bc400d48f19eaa94f26d50d4b8589da106 Reviewed-on: https://gerrit.libreoffice.org/662 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'liblangtag')
-rw-r--r--liblangtag/liblangtag-0.2-xmlCleanupParser.patch20
-rw-r--r--liblangtag/makefile.mk1
2 files changed, 21 insertions, 0 deletions
diff --git a/liblangtag/liblangtag-0.2-xmlCleanupParser.patch b/liblangtag/liblangtag-0.2-xmlCleanupParser.patch
new file mode 100644
index 000000000000..3617125016c6
--- /dev/null
+++ b/liblangtag/liblangtag-0.2-xmlCleanupParser.patch
@@ -0,0 +1,20 @@
+--- misc/liblangtag-0.2/liblangtag/lt-xml.c
++++ misc/build/liblangtag-0.2/liblangtag/lt-xml.c
+@@ -101,8 +101,6 @@ lt_xml_read_subtag_registry(lt_xml_t *x
+ if (xmlparser)
+ xmlFreeParserCtxt(xmlparser);
+
+- xmlCleanupParser();
+-
+ if (err) {
+ if (error)
+ *error = g_error_copy(err);
+@@ -158,8 +156,6 @@ lt_xml_read_cldr_bcp47(lt_xml_t *xml
+ if (xmlparser)
+ xmlFreeParserCtxt(xmlparser);
+
+- xmlCleanupParser();
+-
+ if (err) {
+ if (error)
+ *error = g_error_copy(err);
diff --git a/liblangtag/makefile.mk b/liblangtag/makefile.mk
index 7efbc32fb490..327269836ca7 100644
--- a/liblangtag/makefile.mk
+++ b/liblangtag/makefile.mk
@@ -37,6 +37,7 @@ PATCH_FILES=liblangtag-0.2-0001-Fix-a-memory-leak.patch
PATCH_FILES+=liblangtag-0.2-0002-Fix-invalid-memory-access.patch
PATCH_FILES+=liblangtag-0.2-configure.patch
PATCH_FILES+=liblangtag-0.2-datadir.patch
+PATCH_FILES+=liblangtag-0.2-xmlCleanupParser.patch
CONFIGURE_DIR=.
BUILD_DIR=$(CONFIGURE_DIR)