[lxml-dev] segfaults under python2.3 compiled with gcc 2.95.2
Hi, -- long-post-warning -- I run into segfaults using a python2.3, gcc 2.95.2 - build (yes I know, mighty old compiler :-): Lib versions: lxml 1.1.2 libxml2-2.6.23 libxslt-1.1.15 Tests work fine with everything gcc3.4.4-built, using python2.4 (same lib versions), see below. Both segfaults seem to arise when an error is raised internally (though it is unclear why the first is an error - it does not raise an exception when run under python2.4/gcc3.4.4). 1. Using unprefixed namespace: python2.3 Python 2.3.4 (#6, Jul 20 2004, 11:09:38) [GCC 2.95.2 19991024 (release)] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
from lxml import etree elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""") Segmentation Fault (core dumped)
backtrace: gdb /apps/prod/bin/python2.3 GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.6"... (gdb) r -i -c 'from lxml import etree; elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""")' Starting program: /apps/prod/bin/python2.3 -i -c 'from lxml import etree; elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""")' [New LWP 2 ] [New LWP 3 ] [New LWP 4 ] [New LWP 5 ] Program received signal SIGSEGV, Segmentation fault. 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 (gdb) bt #0 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 #1 0xaa760 in PyThread_release_lock (lock=0x0) at Python/thread_pthread.h:532 #2 0x840c0 in PyEval_ReleaseThread (tstate=0x11abc0) at Python/ceval.c:339 #3 0xa4338 in PyGILState_Release (oldstate=PyGILState_UNLOCKED) at Python/pystate.c:473 #4 0xfe68ceb4 in __pyx_f_5etree__receiveError (__pyx_v_c_log_handler=0x2146c0, __pyx_v_error=0x206700) at src/lxml/etree.c:15789 #5 0xfe4324b4 in __xmlRaiseError (schannel=0xfe68ce68 <__pyx_f_5etree__receiveError>, channel=0xfe432880 <xmlParserWarning>, data=0x2146c0, ctx=0x206580, nod=0x0, domain=1, code=100, level=XML_ERR_WARNING, file=0x0, line=1, str1=0x25f01b "myURI", str2=0x0, str3=0x0, int1=0, col=13, msg=0xfe518560 "xmlns: URI %s is not absolute\n") at error.c:612 #6 0xfe43668c in xmlWarningMsg (ctxt=0xfe518560, error=XML_WAR_NS_URI_RELATIVE, msg=0xfe518560 "xmlns: URI %s is not absolute\n", str1=0x25f01b "myURI", str2=0x0) at parser.c:415 #7 0xfe44593c in xmlParseStartTag2 (ctxt=0x206580, pref=0xffbeee34, URI=0xffbeee30, tlen=0xffbeee2c) at parser.c:7854 #8 0xfe44719c in xmlParseElement (ctxt=0x206580) at parser.c:8437 #9 0xfe448b9c in xmlParseDocument (ctxt=0x206580) at parser.c:9129 #10 0xfe44e454 in xmlDoRead (ctxt=0x206580, URL=0x0, encoding=0x0, options=16386, reuse=1) at parser.c:13101 #11 0xfe44e80c in xmlCtxtReadMemory (ctxt=0x206580, buffer=0x24e568 "", size=29, URL=0x0, encoding=0x0, options=16386) at parser.c:13379 #12 0xfe649bd0 in __pyx_f_5etree_11_BaseParser__parseDoc (__pyx_v_self=0x1c8630, __pyx_v_c_text=0x14f8bc "<RvXML xmlns=\"myURI\"></RvXML>", __pyx_v_c_len=29, __pyx_v_c_filename=0x0) at src/lxml/etree.c:20945 #13 0xfe64d438 in __pyx_f_5etree__parseDoc (__pyx_v_text=0x14f8a8, __pyx_v_filename=0xf78f0, __pyx_v_parser=0x1c8630) at src/lxml/etree.c:22182 #14 0xfe64e5d4 in __pyx_f_5etree__parseMemoryDocument (__pyx_v_text=0x14f8a8, __pyx_v_url=0xf78f0, __pyx_v_parser=0x1c8630) at src/lxml/etree.c:22653 #15 0xfe62a39c in __pyx_f_5etree_XML (__pyx_self=0x1c8630, __pyx_args=0xf78f0, __pyx_kwds=0x0) at src/lxml/etree.c:9712 #16 0xcda64 in PyCFunction_Call (func=0x19a8f0, arg=0x2103f0, kw=0x0) at Objects/methodobject.c:77 #17 0x82238 in call_function (pp_stack=0xffbef2f8, oparg=2163696) at Python/ceval.c:3439 #18 0x7fd6c in eval_frame (f=0x1cd8f8) at Python/ceval.c:2116 #19 0x81318 in PyEval_EvalCodeEx (co=0x18db60, globals=0x0, locals=0x1cd8f8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2663 #20 0x8413c in PyEval_EvalCode (co=0x18db60, globals=0x1349c0, locals=0x1349c0) at Python/ceval.c:537 #21 0xa7164 in run_node (n=0x124158, filename=0x18db60 "", globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1267 #22 0xa7110 in run_err_node (n=0x124158, filename=0x18db60 "", globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1254 #23 0xa6ce0 in PyRun_StringFlags ( str=0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n", start=907888, globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1224 #24 0xa68cc in PyRun_SimpleStringFlags ( command=0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n", flags=0xffbef644) at Python/pythonrun.c:889 #25 0x1e034 in Py_Main (argc=4, argv=0xffbef72c) at Modules/main.c:399 #26 0x1d934 in main (argc=4, argv=0xffbef72c) at Modules/python.c:23 (gdb) Full backtrace: gdb /apps/prod/bin/python2.3 GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.6"... (gdb) r -i -c 'from lxml import etree; elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""")' Starting program: /apps/prod/bin/python2.3 -i -c 'from lxml import etree; elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""")' [New LWP 2 ] [New LWP 3 ] [New LWP 4 ] [New LWP 5 ] Program received signal SIGSEGV, Segmentation fault. 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 (gdb) help bt Print backtrace of all stack frames, or innermost COUNT frames. With a negative argument, print outermost -COUNT frames. Use of the 'full' qualifier also prints the values of the local variables. (gdb) bt full #0 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 No symbol table info available. #1 0xaa760 in PyThread_release_lock (lock=0x0) at Python/thread_pthread.h:532 thelock = (pthread_lock *) 0x0 #2 0x840c0 in PyEval_ReleaseThread (tstate=0x11abc0) at Python/ceval.c:339 No locals. #3 0xa4338 in PyGILState_Release (oldstate=PyGILState_UNLOCKED) at Python/pystate.c:473 tcur = (PyThreadState *) 0x11abc0 #4 0xfe68ceb4 in __pyx_f_5etree__receiveError (__pyx_v_c_log_handler=0x2146c0, __pyx_v_error=0x206700) at src/lxml/etree.c:15789 __pyx_v_gil_state = PyGILState_UNLOCKED #5 0xfe4324b4 in __xmlRaiseError (schannel=0xfe68ce68 <__pyx_f_5etree__receiveError>, channel=0xfe432880 <xmlParserWarning>, data=0x2146c0, ctx=0x206580, nod=0x0, domain=1, code=100, level=XML_ERR_WARNING, file=0x0, line=1, str1=0x25f01b "myURI", str2=0x0, str3=0x0, int1=0, col=13, msg=0xfe518560 "xmlns: URI %s is not absolute\n") at error.c:612 file = 0x0 int1 = 2180800 msg = 0xfe518560 "xmlns: URI %s is not absolute\n" ctxt = 0x206580 node = 0x0 str = 0x209418 "xmlns: URI myURI is not absolute\n" input = 0x206700 to = 0x206700 baseptr = 0x0 #6 0xfe43668c in xmlWarningMsg (ctxt=0xfe518560, error=XML_WAR_NS_URI_RELATIVE, msg=0xfe518560 "xmlns: URI %s is not absolute\n", str1=0x25f01b "myURI", str2=0x0) at parser.c:415 schannel = 0 #7 0xfe44593c in xmlParseStartTag2 (ctxt=0x206580, pref=0xffbeee34, URI=0xffbeee30, tlen=0xffbeee2c) at parser.c:7854 URL = (xmlChar *) 0x25f01b "myURI" uri = 0x20c1a8 q = (xmlChar *) 0x25f01b "myURI" cons = 2146728 len = 5 alloc = 0 localname = (xmlChar *) 0x25f015 "RvXML" prefix = (xmlChar *) 0x0 attname = (xmlChar *) 0x25efea "xmlns" aprefix = (xmlChar *) 0x0 nsname = (xmlChar *) 0x1 <Address 0x1 out of bounds> attvalue = (xmlChar *) 0x260bde "myURI\"></RvXML>" atts = (xmlChar **) 0x0 maxatts = 0 nratts = 0 nbatts = 0 nbdef = 0 i = 2493392 j = 2146728 nbNs = 0 attval = 0 base = (xmlChar *) 0x260bd0 "<RvXML xmlns=\"myURI\"></RvXML>" cur = 1 ---Type <return> to continue, or q <return> to quit--- nsNr = 0 #8 0xfe44719c in xmlParseElement (ctxt=0x206580) at parser.c:8437 name = (xmlChar *) 0x0 prefix = (xmlChar *) 0xfe45f03c "@\003¹¶\221* \001\200¢ " URI = (xmlChar *) 0xffbeee68 "" node_info = { node = 0xffbeee70, begin_pos = 804524, begin_line = 4290704056, end_pos = 1196856, end_line = 1023380 } line = 1 tlen = 5 ret = 0x0 nsNr = 0 #9 0xfe448b9c in xmlParseDocument (ctxt=0x206580) at parser.c:9129 start = "<RvX" enc = 2123136 #10 0xfe44e454 in xmlDoRead (ctxt=0x206580, URL=0x0, encoding=0x0, options=16386, reuse=1) at parser.c:13101 ret = 0x0 #11 0xfe44e80c in xmlCtxtReadMemory (ctxt=0x206580, buffer=0x24e568 "", size=29, URL=0x0, encoding=0x0, options=16386) at parser.c:13379 input = 0x24e568 stream = 0x206580 #12 0xfe649bd0 in __pyx_f_5etree_11_BaseParser__parseDoc (__pyx_v_self=0x1c8630, __pyx_v_c_text=0x14f8bc "<RvXML xmlns=\"myURI\"></RvXML>", __pyx_v_c_len=29, __pyx_v_c_filename=0x0) at src/lxml/etree.c:20945 __pyx_v_state = (PyThreadState *) 0x11abc0 __pyx_v_result = (xmlDoc *) 0x14f8bc __pyx_v_pctxt = (xmlParserCtxt *) 0x206580 __pyx_r = (xmlDoc *) 0x0 __pyx_1 = 0 __pyx_2 = (PyObject *) 0x0 __pyx_3 = (PyObject *) 0x0 __pyx_4 = (xmlDoc *) 0x206580 __pyx_5 = (PyObject *) 0x0 __pyx_6 = (PyObject *) 0x206580 __pyx_7 = (PyObject *) 0x0 #13 0xfe64d438 in __pyx_f_5etree__parseDoc (__pyx_v_text=0x14f8a8, __pyx_v_filename=0xf78f0, __pyx_v_parser=0x1c8630) at src/lxml/etree.c:22182 __pyx_v_c_filename = 0x0 __pyx_v_filename_utf = (PyObject *) 0xf78f0 __pyx_r = (xmlDoc *) 0x14f8a8 __pyx_1 = 0 __pyx_2 = (PyObject *) 0x0 __pyx_4 = (xmlDoc *) 0x1c8630 __pyx_5 = (xmlDoc *) 0x1c8630 #14 0xfe64e5d4 in __pyx_f_5etree__parseMemoryDocument (__pyx_v_text=0x14f8a8, __pyx_v_url=0xf78f0, __pyx_v_parser=0x1c8630) at src/lxml/etree.c:22653 __pyx_r = (struct LxmlDocument * ?) 0x0 ---Type <return> to continue, or q <return> to quit--- __pyx_1 = 0 __pyx_2 = (PyObject *) 0x0 __pyx_3 = (xmlDoc *) 0x14f8a8 #15 0xfe62a39c in __pyx_f_5etree_XML (__pyx_self=0x1c8630, __pyx_args=0xf78f0, __pyx_kwds=0x0) at src/lxml/etree.c:9712 __pyx_v_text = (PyObject *) 0x14f8a8 __pyx_v_parser = (struct __pyx_obj_5etree__BaseParser * ?) 0x1c8630 __pyx_v_doc = (struct LxmlDocument * ?) 0xf78f0 __pyx_r = (PyObject *) 0x1c8630 __pyx_2 = (PyObject *) 0x1c8630 __pyx_argnames = {0xfe696848 "text", 0xfe695728 "parser", 0x0} #16 0xcda64 in PyCFunction_Call (func=0x19a8f0, arg=0x2103f0, kw=0x0) at Objects/methodobject.c:77 meth = 0xfe62a17c <__pyx_f_5etree_XML> self = (PyObject *) 0x0 size = 2163708 #17 0x82238 in call_function (pp_stack=0xffbef2f8, oparg=2163696) at Python/ceval.c:3439 callargs = (PyObject *) 0x2103f0 flags = 2163696 na = 2163696 nk = 0 n = 1 pfunc = (PyObject **) 0x1cda44 func = (PyObject *) 0x19a8f0 x = (PyObject *) 0xffbef2f8 w = (PyObject *) 0x2103f0 #18 0x7fd6c in eval_frame (f=0x1cd8f8) at Python/ceval.c:2116 stack_pointer = (PyObject **) 0x1cda48 next_instr = (unsigned char *) 0x14f97d "Z\003" opcode = 131 oparg = 1 why = WHY_NOT err = 0 x = (PyObject *) 0x14f8a8 v = (PyObject *) 0x19b0d0 w = (PyObject *) 0x19a660 u = (PyObject *) 0x197e90 t = (PyObject *) 0x83 stream = (PyObject *) 0x0 fastlocals = (PyObject **) 0x1cda44 freevars = (PyObject **) 0x1cda44 retval = (PyObject *) 0x0 tstate = (PyThreadState *) 0x11abc0 co = (PyCodeObject *) 0x18db60 instr_ub = -1 instr_lb = 0 first_instr = (unsigned char *) 0x14f964 "d" names = (PyObject *) 0x133930 consts = (PyObject *) 0x196a58 #19 0x81318 in PyEval_EvalCodeEx (co=0x18db60, globals=0x0, locals=0x1cd8f8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2663 ---Type <return> to continue, or q <return> to quit--- kwcount = 0 closure = (PyObject *) 0x14f97d f = (PyFrameObject *) 0x1cd8f8 retval = (PyObject *) 0x0 fastlocals = (PyObject **) 0x1cda44 freevars = (PyObject **) 0x1cda44 tstate = (PyThreadState *) 0x11abc0 x = (PyObject *) 0x0 u = (PyObject *) 0xffffffff #20 0x8413c in PyEval_EvalCode (co=0x18db60, globals=0x1349c0, locals=0x1349c0) at Python/ceval.c:537 No locals. #21 0xa7164 in run_node (n=0x124158, filename=0x18db60 "", globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1267 co = (PyCodeObject *) 0x18db60 v = (PyObject *) 0x124158 #22 0xa7110 in run_err_node (n=0x124158, filename=0x18db60 "", globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1254 No locals. #23 0xa6ce0 in PyRun_StringFlags ( str=0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n", start=907888, globals=0x1349c0, locals=0x1349c0, flags=0xffbef644) at Python/pythonrun.c:1224 No locals. #24 0xa68cc in PyRun_SimpleStringFlags ( command=0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n", flags=0xffbef644) at Python/pythonrun.c:889 m = (PyObject *) 0x11a2d8 d = (PyObject *) 0x11a2d8 v = (PyObject *) 0x101 #25 0x1e034 in Py_Main (argc=4, argv=0xffbef72c) at Modules/main.c:399 c = 1155800 sts = 1138696 command = 0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n" filename = 0x0 fp = (FILE *) 0x116008 p = 0x11a2d8 "from lxml import etree; elt = etree.fromstring(\"\"\"<RvXML xmlns=\"myURI\"></RvXML>\"\"\")\n" inspect = 1 unbuffered = 0 skipfirstline = 0 stdin_is_interactive = 1 help = 0 version = 0 saw_inspect_flag = 1 saw_unbuffered_flag = 1 cf = { cf_flags = 0 } #26 0x1d934 in main (argc=4, argv=0xffbef72c) at Modules/python.c:23 No locals. (gdb) 2. Using illegal tag names: Here is the stack trace (no clue what the "warning: Lowest section in ..." is supposed to mean, btw): PYTHONPATH=/home/hjoukl/pydev/PyTAF/pytaf/__PytafTestInstallation_-Q3-ALPHA/lib/python2.3/site-packages/ gdb /apps/pydev/bin/python2.3 GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.6"... (gdb) r Starting program: /apps/pydev/bin/python2.3 warning: Lowest section in /lib/libdl.so.1 is .dynamic at 0x94 warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 0x74 Python 2.3.4 (#3, Jul 7 2004, 12:07:09) [GCC 2.95.2 19991024 (release)] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
from lxml import etree elt = etree.fromstring('<root><k_status></k_status></root>') elt = etree.fromstring('<root><k+status></k+status></root>')
Program received signal SIGSEGV, Segmentation fault. 0xff138dcc in mutex_lock_impl () from /lib/libc.so.1 (gdb) bt #0 0xff138dcc in mutex_lock_impl () from /lib/libc.so.1 #1 0xaa760 in PyThread_release_lock (lock=0x0) at Python/thread_pthread.h:532 #2 0x840c0 in PyEval_ReleaseThread (tstate=0x119cc8) at Python/ceval.c:339 #3 0xa4338 in PyGILState_Release (oldstate=PyGILState_UNLOCKED) at Python/pystate.c:473 #4 0xfef0ceb4 in __pyx_f_5etree__receiveError (__pyx_v_c_log_handler=0x2179e0, __pyx_v_error=0x209f30) at src/lxml/etree.c:15789 #5 0xfecb24b4 in __xmlRaiseError (schannel=0xfef0ce68 <__pyx_f_5etree__receiveError>, channel=0, data=0x2179e0, ctx=0x209db0, nod=0x0, domain=1, code=68, level=XML_ERR_FATAL, file=0x0, line=1, str1=0x0, str2=0x0, str3=0x0, int1=0, col=9, msg=0xfed982d8 "error parsing attribute name\n") at error.c:612 #6 0xfecb65c0 in xmlFatalErrMsg (ctxt=0x209db0, error=XML_ERR_NAME_REQUIRED, msg=0xfed982d8 "error parsing attribute name\n") at parser.c:387 #7 0xfecc5428 in xmlParseAttribute2 (ctxt=0x209db0, pref=0x0, elem=0x261933 "k", prefix=0xffbfec80, value=0xffbfec7c, len=0xffbfec78, alloc=0xffbfec74) at parser.c:7676 #8 0xfecc5864 in xmlParseStartTag2 (ctxt=0x209db0, pref=0xffbfed04, URI=0xffbfed00, tlen=0xffbfecfc) at parser.c:7838 #9 0xfecc719c in xmlParseElement (ctxt=0x209db0) at parser.c:8437 #10 0xfecc6fa4 in xmlParseContent (ctxt=0x209db0) at parser.c:8361 #11 0xfecc7464 in xmlParseElement (ctxt=0x209db0) at parser.c:8521 #12 0xfecc8b9c in xmlParseDocument (ctxt=0x209db0) at parser.c:9129 #13 0xfecce454 in xmlDoRead (ctxt=0x209db0, URL=0x0, encoding=0x0, options=16386, reuse=1) at parser.c:13101 #14 0xfecce80c in xmlCtxtReadMemory (ctxt=0x209db0, buffer=0x250e78 "", size=34, URL=0x0, encoding=0x0, options=16386) at parser.c:13379 #15 0xfeec9bd0 in __pyx_f_5etree_11_BaseParser__parseDoc (__pyx_v_self=0x21a1f0, __pyx_v_c_text=0x21a274 "<root><k+status></k+status></root>", __pyx_v_c_len=34, __pyx_v_c_filename=0x0) at src/lxml/etree.c:20945 #16 0xfeecd438 in __pyx_f_5etree__parseDoc (__pyx_v_text=0x21a260, __pyx_v_filename=0xf7918, __pyx_v_parser=0x21a1f0) at src/lxml/etree.c:22182 #17 0xfeece5d4 in __pyx_f_5etree__parseMemoryDocument (__pyx_v_text=0x21a260, __pyx_v_url=0xf7918, __pyx_v_parser=0x21a1f0) at src/lxml/etree.c:22653 #18 0xfeeaa39c in __pyx_f_5etree_XML (__pyx_self=0x21a1f0, __pyx_args=0xf7918, __pyx_kwds=0x0) at src/lxml/etree.c:9712 #19 0xcda64 in PyCFunction_Call (func=0x18f328, arg=0x2164d0, kw=0x0) at Objects/methodobject.c:77 #20 0x82238 in call_function (pp_stack=0xffbff2d0, oparg=2188496) at Python/ceval.c:3439 #21 0x7fd6c in eval_frame (f=0x179688) at Python/ceval.c:2116 #22 0x81318 in PyEval_EvalCodeEx (co=0x21a2a0, globals=0x0, locals=0x179688, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2663 #23 0x8413c in PyEval_EvalCode (co=0x21a2a0, globals=0x1349c0, locals=0x1349c0) at Python/ceval.c:537 #24 0xa7164 in run_node (n=0x1236c8, filename=0x21a2a0 "", globals=0x1349c0, locals=0x1349c0, flags=0xffbff64c) at Python/pythonrun.c:1267 #25 0xa53f8 in PyRun_InteractiveOneFlags (fp=0x1236c8, filename=0xd0ed8 "<stdin>", flags=0xffbff64c) at Python/pythonrun.c:757 #26 0xa6a94 in PyRun_InteractiveLoopFlags (fp=0x116008, filename=0xd0ed8 "<stdin>", flags=0xffbff64c) at Python/pythonrun.c:690 #27 0xa683c in PyRun_AnyFileExFlags (fp=0x116008, filename=0xd0ed8 "<stdin>", closeit=0, flags=0xffbff64c) at Python/pythonrun.c:653 #28 0x1e0fc in Py_Main (argc=1, argv=0xffbff734) at Modules/main.c:415 #29 0x1d934 in main (argc=1, argv=0xffbff734) at Modules/python.c:23 (gdb) Both work fine with python2.4, compiled with gcc 3.4.4: 1. $ /apps/pydev/gcc/3.4.4/bin/python2.4 Python 2.4.3 (#1, Apr 12 2006, 11:57:09) [GCC 3.4.4] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
from lxml import etree elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""")
2. $ /apps/pydev/gcc/3.4.4/bin/python2.4 Python 2.4.3 (#1, Apr 12 2006, 11:57:09) [GCC 3.4.4] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
from lxml import etree elt = etree.fromstring('<root><k_status></k_status></root>') elt = etree.fromstring('<root><k+status></k+status></root>') Traceback (most recent call last): File "<stdin>", line 1, in ? File "etree.pyx", line 1695, in etree.XML File "parser.pxi", line 920, in etree._parseMemoryDocument File "parser.pxi", line 816, in etree._parseDoc File "parser.pxi", line 502, in etree._BaseParser._parseDoc File "parser.pxi", line 605, in etree._handleParseResult File "parser.pxi", line 576, in etree._raiseParseError etree.XMLSyntaxError: line 1: Extra content at the end of the document
Greetings, Holger P.S.: I haven't forgotten about the objectify benchmarks, but these days I find it hard dedicating myself to the true cause - but one fine day I hope to come up with them. Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde, verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte den Inhalt der E-Mail als Hardcopy an. The contents of this e-mail are confidential. If you are not the named addressee or if this transmission has been addressed to you in error, please notify the sender immediately and then delete this e-mail. Any unauthorized copying and transmission is forbidden. E-Mail transmission cannot be guaranteed to be secure. If verification is required, please request a hard copy version.
Hi Holger, Holger Joukl wrote:
I run into segfaults using a python2.3, gcc 2.95.2 - build (yes I know, mighty old compiler :-):
and difficult to track down problems. Impossible to say if it's because of a specific system environment (who compiled your pthreads, for example? where did your Python binary come from?) or because of the compiler itself, specific compiler options... Have you tried it with 'safe' options like "-O -m386" and the like? (or the same for Solaris respectively).
Tests work fine with everything gcc3.4.4-built, using python2.4 (same lib versions)
Did you use the same compiler for the libs?
Both segfaults seem to arise when an error is raised internally (though it is unclear why the first is an error - it does not raise an exception when run under python2.4/gcc3.4.4).
But the stack trace tells me that you got a warning from libxml2 that went up into the Python environment:
1. Using unprefixed namespace:
python2.3
elt = etree.fromstring("""<RvXML xmlns="myURI"></RvXML>""") Segmentation Fault (core dumped)
Program received signal SIGSEGV, Segmentation fault. 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 (gdb) bt #0 0xff07b760 in pthread_mutex_lock () from /usr/lib/libthread.so.1 #1 0xaa760 in PyThread_release_lock (lock=0x0) at Python/thread_pthread.h:532 #2 0x840c0 in PyEval_ReleaseThread (tstate=0x11abc0) at Python/ceval.c:339 #3 0xa4338 in PyGILState_Release (oldstate=PyGILState_UNLOCKED) at Python/pystate.c:473 #4 0xfe68ceb4 in __pyx_f_5etree__receiveError (__pyx_v_c_log_handler=0x2146c0, __pyx_v_error=0x206700) at src/lxml/etree.c:15789 #5 0xfe4324b4 in __xmlRaiseError (schannel=0xfe68ce68 <__pyx_f_5etree__receiveError>, channel=0xfe432880 <xmlParserWarning>, data=0x2146c0, ctx=0x206580, nod=0x0, domain=1, code=100, level=XML_ERR_WARNING, file=0x0, line=1, str1=0x25f01b "myURI", str2=0x0, str3=0x0, int1=0, col=13, msg=0xfe518560 "xmlns: URI %s is not absolute\n") at error.c:612 #6 0xfe43668c in xmlWarningMsg (ctxt=0xfe518560, error=XML_WAR_NS_URI_RELATIVE, msg=0xfe518560 "xmlns: URI %s is not absolute\n", str1=0x25f01b "myURI", str2=0x0) at parser.c:415 [...]
Anyway, it doesn't look like the error is the cause, it's more because of a problem when acquiring the GIL.
2. Using illegal tag names:
Here is the stack trace (no clue what the "warning: Lowest section in ..." is supposed to mean, btw):
elt = etree.fromstring('<root><k+status></k+status></root>')
Program received signal SIGSEGV, Segmentation fault. 0xff138dcc in mutex_lock_impl () from /lib/libc.so.1 (gdb) bt #0 0xff138dcc in mutex_lock_impl () from /lib/libc.so.1 #1 0xaa760 in PyThread_release_lock (lock=0x0) at Python/thread_pthread.h:532 #2 0x840c0 in PyEval_ReleaseThread (tstate=0x119cc8) at Python/ceval.c:339 #3 0xa4338 in PyGILState_Release (oldstate=PyGILState_UNLOCKED) at Python/pystate.c:473 #4 0xfef0ceb4 in __pyx_f_5etree__receiveError (__pyx_v_c_log_handler=0x2179e0, __pyx_v_error=0x209f30) at src/lxml/etree.c:15789 #5 0xfecb24b4 in __xmlRaiseError (schannel=0xfef0ce68 <__pyx_f_5etree__receiveError>, channel=0, data=0x2179e0, ctx=0x209db0, nod=0x0, domain=1, code=68, level=XML_ERR_FATAL, file=0x0, line=1, str1=0x0, str2=0x0, str3=0x0, int1=0, col=9, msg=0xfed982d8 "error parsing attribute name\n") at error.c:612 #6 0xfecb65c0 in xmlFatalErrMsg (ctxt=0x209db0, error=XML_ERR_NAME_REQUIRED, msg=0xfed982d8 "error parsing attribute name\n") at parser.c:387
Looks pretty similar to me, both segfault in pthreads mutex calls. Maybe it's not a compiler issue but an issue with Python 2.3 on Solaris - or a mixture of many causes...
Both work fine with python2.4, compiled with gcc 3.4.4: [...]
Uhm, on the same machine? What do you need the gcc 2.95 for, then? Personally, I feel no big incentive in supporting a compiler as old as 2.95. GCC is at version 4 by now and if we run fine with 3.4, that's all I'd ask for. Stefan
Hi Stefan, no segfault with gcc2.95.2-built python2.4, see below...still testing. Stefan Behnel <behnel_ml@gkec.informatik.tu-darmstadt.de> schrieb am 17.11.2006 20:06:20:
Hi Holger,
Holger Joukl wrote:
I run into segfaults using a python2.3, gcc 2.95.2 - build (yes I know, mighty old compiler :-):
and difficult to track down problems. Impossible to say if it's because of a specific system environment (who compiled your pthreads, for example? where did your Python binary come from?) or because of the compiler itself, specific compiler options...
Have you tried it with 'safe' options like "-O -m386" and the like? (or
same for Solaris respectively).
Tests work fine with everything gcc3.4.4-built, using python2.4 (same
We compile Python from source, pthreads comes with Solaris afaik. So in theory I have control over the usage of compiler options. I tried some more combinations and do not run into the segfault with a gcc2.95.2-built python2.4.3 So my current best guess would be it is some python2.3-related problem. I _do_ run into the segfault in every combination where I used python2.3 built with gcc2.95.2. I haven't tried building python2.3 with gcc3.4.4 so maybe I will do this if I find time. the lib
versions)
Did you use the same compiler for the libs?
Yes, gcc 3.4.4 for python interpreter, libxml2, libxslt, lxml.
Both segfaults seem to arise when an error is raised internally (though it is unclear why the first is an error - it does not raise an exception when run under python2.4/gcc3.4.4).
But the stack trace tells me that you got a warning from libxml2 that went up into the Python environment: [...] Looks pretty similar to me, both segfault in pthreads mutex calls. Maybe it's not a compiler issue but an issue with Python 2.3 on Solaris - or a mixture of many causes...
Both work fine with python2.4, compiled with gcc 3.4.4: [...]
Uhm, on the same machine? What do you need the gcc 2.95 for, then?
Yes, on the same sparc solaris box. The reason for sticking to gcc 2.95.2 is an old _heavily_ modified boost.python we used to auto-wrap (with openc++) the TIB/Rv-API. Due to different partial template specialization with newer compilers this mechanism cannot be easily changed, if at all. A main reason why we want to get rid of this, migrating either to a newer boost version or another wrapping tool. But we have successfully tried running the old rv module with the gcc3.4.4-built python2.4 so we are not really stuck here.
Personally, I feel no big incentive in supporting a compiler as old as 2.95. GCC is at version 4 by now and if we run fine with 3.4, that's all I'd ask for.
Stefan
For plain C programs I think gcc 2.95.2 should still work. Holger Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde, verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte den Inhalt der E-Mail als Hardcopy an. The contents of this e-mail are confidential. If you are not the named addressee or if this transmission has been addressed to you in error, please notify the sender immediately and then delete this e-mail. Any unauthorized copying and transmission is forbidden. E-Mail transmission cannot be guaranteed to be secure. If verification is required, please request a hard copy version.
participants (2)
-
Holger Joukl
-
Stefan Behnel