[XML-SIG] core dumps in stylesheetreader/pyexpat?

Uche Ogbuji uche.ogbuji@fourthought.com
17 Sep 2002 10:13:45 -0600


It turns out that the mysterious core dumps I've been having with 4XSLT
are in stylesheetReader.  I took a closer look at the trace:


#0  0x400cb80d in free () from /lib/libc.so.6
(gdb) 
(gdb) bt
#0  0x400cb80d in free () from /lib/libc.so.6
#1  0x400cb6d3 in free () from /lib/libc.so.6
#2  0x4033116f in XML_ParserFree (parser=0x84d1308)
    at extensions/expat/lib/xmlparse.c:1003
#3  0x4032ecef in xmlparse_dealloc (self=0x84c8a14)
    at extensions/pyexpat.c:1294
#4  0x080974a6 in collect (young=0x80e826c, old=0x80e8278)
    at Modules/gcmodule.c:343
#5  0x08097770 in collect_generations () at Modules/gcmodule.c:478
#6  0x08097c6e in _PyObject_GC_New (tp=0x80f1960) at
Modules/gcmodule.c:847
#7  0x080ba17d in PyList_New (size=2) at Objects/listobject.c:64
#8  0x0807570c in eval_frame (f=0x84654d4) at Python/ceval.c:1760
#9  0x08076d5d in PyEval_EvalCodeEx (co=0x83a9de0, globals=0x839d18c, 
    locals=0x0, args=0x8465174, argcount=3, kws=0x8465180, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#10 0x08078db8 in fast_function (func=0x839fd34, pp_stack=0xbfffdf44,
n=3, 
    na=3, nk=0) at Python/ceval.c:3161
#11 0x08075e21 in eval_frame (f=0x8465014) at Python/ceval.c:2024
#12 0x08076d5d in PyEval_EvalCodeEx (co=0x839bcd8, globals=0x839d18c, 
    locals=0x0, args=0x84c7a40, argcount=3, kws=0x84c7a4c, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#13 0x08078db8 in fast_function (func=0x83ab28c, pp_stack=0xbfffe094,
n=3, 
    na=3, nk=0) at Python/ceval.c:3161
---Type <return> to continue, or q <return> to quit---
#14 0x08075e21 in eval_frame (f=0x84c786c) at Python/ceval.c:2024
#15 0x08076d5d in PyEval_EvalCodeEx (co=0x83944c8, globals=0x839748c, 
    locals=0x0, args=0x85440d0, argcount=3, kws=0x0, kwcount=0,
defs=0x0, 
    defcount=0, closure=0x0) at Python/ceval.c:2585
#16 0x080b7b49 in function_call (func=0x83db884, arg=0x85440c4, kw=0x0)
    at Objects/funcobject.c:374
#17 0x080a6710 in PyObject_Call (func=0x83db884, arg=0x85440c4, kw=0x0)
    at Objects/abstract.c:1684
#18 0x080ad02f in instancemethod_call (func=0x83db884, arg=0x84672ac,
kw=0x0)
    at Objects/classobject.c:2276
#19 0x080a6710 in PyObject_Call (func=0x84ba91c, arg=0x84672ac, kw=0x0)
    at Objects/abstract.c:1684
#20 0x0807753f in PyEval_CallObjectWithKeywords (func=0x84ba91c, 
    arg=0x84672ac, kw=0x0) at Python/ceval.c:3049
#21 0x4032baa0 in call_with_frame (c=0x84b84c8, func=0x84ba91c,
args=0x84672ac)
    at extensions/pyexpat.c:335
#22 0x4032c028 in my_StartElementHandler (userData=0x84cad14, 
    name=0x85313a8 "http://www.w3.org/1999/XSL/Transform param", 
    atts=0x852f508) at extensions/pyexpat.c:526
#23 0x40331b9e in doContent (parser=0x852f270, startTagLevel=0, 
    enc=0x40352e20, 
    s=0x854232b "<xsl:param name=\"length\" select=\"'0pt'\"/>\n\n 
<xsl:choose>\n    <xsl:when test=\"string-length($length) = 0\"/>\n   
<xsl:when test=\"subs---Type <return> to continue, or q <return> to
quit---
tring($length,1,1) = '0'", ' ' <repeats 21 times>, "or
substring($length,1,"..., end=0x854258e "", nextPtr=0x852f288) at
extensions/expat/lib/xmlparse.c:2058
#24 0x40337af4 in contentProcessor (parser=0x852f270, 
    start=0x84d4a28 "ribute-set", 
    end=0x732d6574 <Address 0x732d6574 out of bounds>, endPtr=0x852f288)
    at extensions/expat/lib/xmlparse.c:1691
#25 0x40337787 in XML_ParseBuffer (parser=0x852f270, len=2048,
isFinal=0)
    at extensions/expat/lib/xmlparse.c:1394
#26 0x4032e899 in xmlparse_ParseFile (self=0x84cad14, args=0x84b7b24)
    at extensions/pyexpat.c:931
#27 0x080c35b4 in PyCFunction_Call (func=0x83f3400, arg=0x84b7b24,
kw=0x0)
    at Objects/methodobject.c:80
#28 0x08075d83 in eval_frame (f=0x84b17d4) at Python/ceval.c:2004
#29 0x08076d5d in PyEval_EvalCodeEx (co=0x83f9698, globals=0x837ec14, 
    locals=0x0, args=0x817864c, argcount=2, kws=0x8178654, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#30 0x08078db8 in fast_function (func=0x83ff554, pp_stack=0xbfffe624,
n=2, 
    na=2, nk=0) at Python/ceval.c:3161
#31 0x08075e21 in eval_frame (f=0x81784e4) at Python/ceval.c:2024
#32 0x08076d5d in PyEval_EvalCodeEx (co=0x83f9780, globals=0x837ec14, 
    locals=0x0, args=0x819e340, argcount=2, kws=0x819e348, kwcount=0, 
    defs=0x83fb338, defcount=1, closure=0x0) at Python/ceval.c:2585
#33 0x08078db8 in fast_function (func=0x84007cc, pp_stack=0xbfffe774,
n=2, 
---Type <return> to continue, or q <return> to quit---
    na=2, nk=0) at Python/ceval.c:3161
#34 0x08075e21 in eval_frame (f=0x819e1c4) at Python/ceval.c:2024
#35 0x08076d5d in PyEval_EvalCodeEx (co=0x8395a48, globals=0x839748c, 
    locals=0x0, args=0x84b86ec, argcount=3, kws=0x84b86f8, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#36 0x08078db8 in fast_function (func=0x83dba7c, pp_stack=0xbfffe8c4,
n=3, 
    na=3, nk=0) at Python/ceval.c:3161
#37 0x08075e21 in eval_frame (f=0x84b851c) at Python/ceval.c:2024
#38 0x08076d5d in PyEval_EvalCodeEx (co=0x83944c8, globals=0x839748c, 
    locals=0x0, args=0x84b0ad8, argcount=3, kws=0x0, kwcount=0,
defs=0x0, 
    defcount=0, closure=0x0) at Python/ceval.c:2585
#39 0x080b7b49 in function_call (func=0x83db884, arg=0x84b0acc, kw=0x0)
    at Objects/funcobject.c:374
#40 0x080a6710 in PyObject_Call (func=0x83db884, arg=0x84b0acc, kw=0x0)
    at Objects/abstract.c:1684
#41 0x080ad02f in instancemethod_call (func=0x83db884, arg=0x8468cf4,
kw=0x0)
    at Objects/classobject.c:2276
#42 0x080a6710 in PyObject_Call (func=0x836dfd4, arg=0x8468cf4, kw=0x0)
    at Objects/abstract.c:1684
#43 0x0807753f in PyEval_CallObjectWithKeywords (func=0x836dfd4, 
    arg=0x8468cf4, kw=0x0) at Python/ceval.c:3049
#44 0x4032baa0 in call_with_frame (c=0x84b84c8, func=0x836dfd4,
args=0x8468cf4)
    at extensions/pyexpat.c:335
---Type <return> to continue, or q <return> to quit---
#45 0x4032c028 in my_StartElementHandler (userData=0x84216fc, 
    name=0x84b7de8 "http://www.w3.org/1999/XSL/Transform include", 
    atts=0x84b5e38) at extensions/pyexpat.c:526
#46 0x40331b9e in doContent (parser=0x84b5ba0, startTagLevel=0, 
    enc=0x40352e20, 
    s=0x84b76a9 "<xsl:include href=\"../lib/lib.xsl\"/>\n<xsl:include
href=\"../common/l10n.xsl\"/>\n<xsl:include
href=\"../common/common.xsl\"/>\n<xsl:include
href=\"../common/labels.xsl\"/>\n<xsl:include
href=\"../common/titles."..., 
    end=0x84b7b10 "", nextPtr=0x84b5bb8)
    at extensions/expat/lib/xmlparse.c:2058
#47 0x40333b4e in doProlog (parser=0x84b5ba0, enc=0x40352e20, 
    s=0x84b7326 "<xsl:stylesheet
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n", ' ' <repeats 16
times>, "xmlns:doc=\"http://nwalsh.com/xsl/documentation/1.0\"\n", ' '
<repeats 16 times>, "exclude-result-prefixes=\"doc\"\n", ' ' <repeats 16
times>, "versi"..., end=0x84b7b10 "", tok=29, 
    next=0x84b7326 "<xsl:stylesheet
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n", ' ' <repeats 16
times>, "xmlns:doc=\"http://nwalsh.com/xsl/documentation/1.0\"\n", ' '
<repeats 16 times>, "exclude-result-prefixes=\"doc\"\n", ' ' <repeats 16
times>, "versi"..., nextPtr=0x84b5bb8)
    at extensions/expat/lib/xmlparse.c:1691
#48 0x4033903f in prologProcessor (parser=0x84b5ba0, 
    s=0x84b7310 "<?xml version='1.0'?>\n<xsl:stylesheet
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n", ' ' <repeats 16
times>, "xmlns:doc=\"http://nwals---Type <return> to continue, or q
<return> to quit---
h.com/xsl/documentation/1.0\"\n", ' ' <repeats 16 times>,
"exclude-result-prefixes=\"doc\""..., end=0x84b7b10 "",
nextPtr=0x84b5bb8)
    at extensions/expat/lib/xmlparse.c:3096
#49 0x40337ab3 in prologInitProcessor (parser=0x84b5ba0, 
    s=0x84b7310 "<?xml version='1.0'?>\n<xsl:stylesheet
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n", ' ' <repeats 16
times>, "xmlns:doc=\"http://nwalsh.com/xsl/documentation/1.0\"\n", ' '
<repeats 16 times>, "exclude-result-prefixes=\"doc\""..., end=0x84b7b10
"", nextPtr=0x84b5bb8)
    at extensions/expat/lib/xmlparse.c:2927
#50 0x40337787 in XML_ParseBuffer (parser=0x84b5ba0, len=2048,
isFinal=0)
    at extensions/expat/lib/xmlparse.c:1394
#51 0x4032e899 in xmlparse_ParseFile (self=0x84216fc, args=0x84b1184)
    at extensions/pyexpat.c:931
#52 0x080c35b4 in PyCFunction_Call (func=0x840f9e8, arg=0x84b1184,
kw=0x0)
    at Objects/methodobject.c:80
#53 0x08075d83 in eval_frame (f=0x83f7ce4) at Python/ceval.c:2004
#54 0x08076d5d in PyEval_EvalCodeEx (co=0x83f9698, globals=0x837ec14, 
    locals=0x0, args=0x8426aec, argcount=2, kws=0x8426af4, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#55 0x08078db8 in fast_function (func=0x83ff554, pp_stack=0xbfffef14,
n=2, 
    na=2, nk=0) at Python/ceval.c:3161
#56 0x08075e21 in eval_frame (f=0x8426984) at Python/ceval.c:2024
#57 0x08076d5d in PyEval_EvalCodeEx (co=0x83f9780, globals=0x837ec14, 
---Type <return> to continue, or q <return> to quit---
    locals=0x0, args=0x81ce7e8, argcount=2, kws=0x81ce7f0, kwcount=1, 
    defs=0x83fb338, defcount=1, closure=0x0) at Python/ceval.c:2585
#58 0x08078db8 in fast_function (func=0x84007cc, pp_stack=0xbffff064,
n=4, 
    na=2, nk=1) at Python/ceval.c:3161
#59 0x08075e21 in eval_frame (f=0x81ce68c) at Python/ceval.c:2024
#60 0x08076d5d in PyEval_EvalCodeEx (co=0x83851c0, globals=0x8378b2c, 
    locals=0x0, args=0x84207c4, argcount=2, kws=0x84207cc, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#61 0x08078db8 in fast_function (func=0x83e5a14, pp_stack=0xbffff1b4,
n=2, 
    na=2, nk=0) at Python/ceval.c:3161
#62 0x08075e21 in eval_frame (f=0x84205fc) at Python/ceval.c:2024
#63 0x08076d5d in PyEval_EvalCodeEx (co=0x836da40, globals=0x8378604, 
    locals=0x0, args=0x818ecb4, argcount=2, kws=0x818ecbc, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#64 0x08078db8 in fast_function (func=0x83f2054, pp_stack=0xbffff304,
n=2, 
    na=2, nk=0) at Python/ceval.c:3161
#65 0x08075e21 in eval_frame (f=0x818eb5c) at Python/ceval.c:2024
#66 0x08076d5d in PyEval_EvalCodeEx (co=0x841a788, globals=0x841bc8c, 
    locals=0x0, args=0x8378864, argcount=2, kws=0x837886c, kwcount=0, 
    defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2585
#67 0x08078db8 in fast_function (func=0x841cc44, pp_stack=0xbffff454,
n=2, 
    na=2, nk=0) at Python/ceval.c:3161
#68 0x08075e21 in eval_frame (f=0x8378704) at Python/ceval.c:2024
---Type <return> to continue, or q <return> to quit---
#69 0x08076d5d in PyEval_EvalCodeEx (co=0x83ff2b0, globals=0x8419564, 
    locals=0x0, args=0x81126e8, argcount=1, kws=0x81126ec, kwcount=0, 
    defs=0x83fee40, defcount=2, closure=0x0) at Python/ceval.c:2585
#70 0x08078db8 in fast_function (func=0x841c0ac, pp_stack=0xbffff5a4,
n=1, 
    na=1, nk=0) at Python/ceval.c:3161
#71 0x08075e21 in eval_frame (f=0x811259c) at Python/ceval.c:2024
#72 0x08076d5d in PyEval_EvalCodeEx (co=0x8119450, globals=0x810b5e4, 
    locals=0x810b5e4, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, 
    defcount=0, closure=0x0) at Python/ceval.c:2585
#73 0x08078d59 in PyEval_EvalCode (co=0x8119450, globals=0x810b5e4, 
    locals=0x810b5e4) at Python/ceval.c:483
#74 0x08092ee3 in run_node (n=0x811e008, 
    filename=0xbffff969
"/home/uogbuji/lib/python2.2/site-packages/Ft/Share/Bin/4xslt",
globals=0x810b5e4, locals=0x810b5e4, flags=0xbffff7a8)
    at Python/pythonrun.c:1079
#75 0x08092e9e in run_err_node (n=0x811e008, 
    filename=0xbffff969
"/home/uogbuji/lib/python2.2/site-packages/Ft/Share/Bin/4xslt",
globals=0x810b5e4, locals=0x810b5e4, flags=0xbffff7a8)
    at Python/pythonrun.c:1066
#76 0x08092b2a in PyRun_FileExFlags (fp=0x80fbd28, 
    filename=0xbffff969
"/home/uogbuji/lib/python2.2/site-packages/Ft/Share/Bin/4xslt",
start=257, globals=0x810b5e4, locals=0x810b5e4, closeit=1, 
    flags=0xbffff7a8) at Python/pythonrun.c:1057
---Type <return> to continue, or q <return> to quit---
#77 0x080917f1 in PyRun_SimpleFileExFlags (fp=0x80fbd28, 
    filename=0xbffff969
"/home/uogbuji/lib/python2.2/site-packages/Ft/Share/Bin/4xslt",
closeit=1, flags=0xbffff7a8) at Python/pythonrun.c:685
#78 0x080926ec in PyRun_AnyFileExFlags (fp=0x80fbd28, 
    filename=0xbffff969
"/home/uogbuji/lib/python2.2/site-packages/Ft/Share/Bin/4xslt",
closeit=1, flags=0xbffff7a8) at Python/pythonrun.c:495
#79 0x08053494 in Py_Main (argc=4, argv=0xbffff834) at
Modules/main.c:364
#80 0x08052d78 in main (argc=4, argv=0xbffff834) at Modules/python.c:10


---

I am using latest Python 2.2.1 + PyXML from CVS, not Python+pyexpat. 
Any other developers with this config?

It seems it is certain features in the styleshet that trigger the dump. 
I'm not yet sure which, but I have found that though it sometimes passes
without a core dump, when it does, it is always certain files that cause
it.  Unfortunately, I have not been lucky at all with the huge (nwalsh)
docbook stylesheets.  I get a core dump every time.

Ideas?


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Apache 2.0 API -
http://www-106.ibm.com/developerworks/linux/library/l-apache/
Basic XML and RDF techniques for knowledge management, Part 7 -
http://www-106.ibm.com/developerworks/xml/library/x-think12.html
Keeping pace with James Clark -
http://www-106.ibm.com/developerworks/xml/library/x-jclark.html