Kaydet (Commit) d68113f3 authored tarafından Michael Stahl's avatar Michael Stahl

soffice.bin: add a hack to detect calls to xmlCleanupParser

xmlCleanupParser frees libxml2's global variables, accessing those later
on leads to hard to debug crashes.  Because libxml2 is used indirectly
by lots of different components, nobody is allwed to free its globals.

Change-Id: I05381d3dada217db44e96445d6f6d63014f57241
üst e5d64a0c
...@@ -25,4 +25,18 @@ SAL_IMPLEMENT_MAIN() { ...@@ -25,4 +25,18 @@ SAL_IMPLEMENT_MAIN() {
return soffice_main(); return soffice_main();
} }
#ifdef DBG_UTIL
#ifdef __gnu_linux__
#include <stdio.h>
#include <stdlib.h>
/* HACK: detect calls to xmlCleanupParser, which causes hard to debug crashes */
__attribute__ ((visibility("default"))) void xmlCleanupParser(void)
{
fprintf(stderr, "\n*** ERROR: DO NOT call xmlCleanupParser()\n\n");
abort();
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -127,7 +127,13 @@ bool isInternalContext(librdf_node *i_pNode) throw () ...@@ -127,7 +127,13 @@ bool isInternalContext(librdf_node *i_pNode) throw ()
// so they need to be wrapped to be usable with boost::shared_ptr. // so they need to be wrapped to be usable with boost::shared_ptr.
static void safe_librdf_free_world(librdf_world *const world) static void safe_librdf_free_world(librdf_world *const world)
{ {
#if 1
(void)world; // leak it
#else
// disable this for now: it calls xmlCleanupParser, which now aborts
// (see desktop/source/app/main.c)
if (world) { librdf_free_world(world); } if (world) { librdf_free_world(world); }
#endif
} }
static void safe_librdf_free_model(librdf_model *const model) static void safe_librdf_free_model(librdf_model *const model)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment