Re: [xml] xmlGcMemSetup & xmlMemSetup



I tried to use gdb to debug the sorce I attached last email.
The instruction in my source which gives me the error is:

res = xsltApplyStylesheet(cur, doc, NULL);

Going inside with gdb I found the error here:
....
848                         f(iter->payload, data, iter->name,
(gdb) s
stubHashScannerFull (payload=0x811b0e8, data=0xbffff658, name=0x811b128 "urlbase", name2=0x0, name3=0x0) at hash.c:802 802 stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name);
(gdb) s
800                          const xmlChar *name3 ATTRIBUTE_UNUSED) {
(gdb) s
802 stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x402191e6 in chunk_free (ar_ptr=0x402cac80, p=0x811f778) at malloc.c:3242
3242    malloc.c: No such file or directory.
       in malloc.c

I tried to print the stack:

(gdb) bt
#0 0x402191e6 in chunk_free (ar_ptr=0x402cac80, p=0x811f778) at malloc.c:3242
#1  0x40218fc0 in __libc_free (mem=0x811f780) at malloc.c:3154
#2  0x08048a56 in xml2_free (emem=0x811f788) at main.c:42
#3 0x4004823d in xsltValueOf (ctxt=0x81235e8, node=0x805b568, inst=0x80708a0, castedComp=0x806bf20) at transform.c:4440 #4 0x40045b92 in xsltApplySequenceConstructor (ctxt=0x81235e8, contextNode=0x805b568, list=0x80706f0, templ=0x0)
   at transform.c:2582
#5 0x40046593 in xsltApplyOneTemplate (ctxt=0x81235e8, contextNode=0x805b568, list=0x80706f0, templ=0x0, params=0x0)
   at transform.c:3174
#6 0x40036909 in xsltEvalGlobalVariable (elem=0x811b0e8, ctxt=0x81235e8) at variables.c:1180 #7 0x400ad3c0 in stubHashScannerFull (payload=0x811b0e8, data=0xbffff658, name=0x811b128 "urlbase", name2=0x0, name3=0x0)
   at hash.c:802
#8 0x400ad469 in xmlHashScanFull (table=0x811aa80, f=0x400ad3ac <stubHashScannerFull>, data=0xbffff658) at hash.c:848 #9 0x400ad3f9 in xmlHashScan (table=0x811aa80, f=0x40036614 <xsltEvalGlobalVariable>, data=0x81235e8) at hash.c:818 #10 0x40036b40 in xsltEvalGlobalVariables (ctxt=0x81235e8) at variables.c:1288 #11 0x40049e18 in xsltApplyStylesheetInternal (style=0x804b308, doc=0x805b568, params=0x0, output=0x0, profile=0x0, userCtxt=0x0)
   at transform.c:6011
#12 0x4004a216 in xsltApplyStylesheet (style=0x804b308, doc=0x805b568, params=0x0) at transform.c:6221
#13 0x08048c6a in main (argc=1, argv=0xbffff7ac) at main.c:168
#14 0x401b8336 in __libc_start_main (main=0x8048bb0 <main>, argc=1, ubp_av=0xbffff7ac, init=0x804876c <_init>, fini=0x8048d50 <_fini>, rtld_fini=0x4000d2fc <_dl_fini>, stack_end=0xbffff79c) at ../sysdeps/generic/libc-start.c:129


Could you help me to find the error?
Did you try to compile my source and executes it?
If in my original source I try to comment:

xmlMemSetup(xml2_free, xml2_alloc, xml2_realloc, xml2_strdup);

all is ok.

Best regards


Marco


Daniel Veillard ha scritto:
On Wed, Aug 08, 2007 at 11:14:47AM +0200, Marco Spinetti wrote:
Is tehre some problems if you use xmlMemSetup and libxslt?

  No it should not. Others have done it. Use a debugger and
find out what happens,
Daniel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]