Hi,
here is another piece of the puzzle, hunting down a segfault/bus error
problem:
This time, my program did not core dump but seemed to hang in an endless
loop in
an ElementDepthFirstIterator:
(gdb) where
#0 0xfe0a2f3c in __pyx_f_5etree__elementFactory (__pyx_v_doc=0x4053a0,
__pyx_v_c_node=0xdef3e0)
at src/lxml/etree.c:7120
#1 0xfe0a80ac in __pyx_f_5etree_25ElementDepthFirstIterator___next__
(__pyx_v_self=0x3ff8a0)
at src/lxml/etree.c:9081
#2 0x3b35c in listextend (self=0xdb0558, b=0xdd6fd0) at
Objects/listobject.c:825
#3 0x3d028 in list_init (self=0xdb0558, args=0x417e30, kw=0x0) at
Objects/listobject.c:2376
#4 0x58220 in type_call (type=0x107f7c, args=0x417e30, kwds=0x0) at
Objects/typeobject.c:435
#5 0x26028 in PyObject_Call (func=0xdb0558, arg=0x417e30, kw=0x0) at
Objects/abstract.c:1795
#6 0x8a514 in do_call (func=0x107f7c, pp_stack=0xfd108fa0, na=-1,
nk=4292144) at Python/ceval.c:3771
#7 0x88324 in call_function (pp_stack=0xfd108fa0, oparg=1) at
Python/ceval.c:3586
#8 0x8565c in PyEval_EvalFrame (f=0xbfc488) at Python/ceval.c:2163
#9 0x86b14 in PyEval_EvalCodeEx (co=0x3a9de0, globals=0x0,
locals=0xbfc488, args=0xea400,
argcount=959488, kws=0xea400, kwcount=1, defs=0x0, defcount=0,
closure=0x0) at Python/ceval.c:2736
#10 0x884e4 in fast_function (func=0x3b15b0, pp_stack=0xfd1091f0, n=5,
na=959488, nk=1)
at Python/ceval.c:3656
#11 0x8830c in call_function (pp_stack=0xfd1091f0, oparg=3) at
Python/ceval.c:3584
#12 0x8565c in PyEval_EvalFrame (f=0xdfde88) at Python/ceval.c:2163
#13 0x86b14 in PyEval_EvalCodeEx (co=0x3a9ce0, globals=0x0,
locals=0xdfde88, args=0xea400,
argcount=959488, kws=0xea400, kwcount=1, defs=0x0, defcount=0,
closure=0x0) at Python/ceval.c:2736
#14 0x884e4 in fast_function (func=0x3a9ef0, pp_stack=0xfd109440, n=5,
na=959488, nk=1)
at Python/ceval.c:3656
#15 0x8830c in call_function (pp_stack=0xfd109440, oparg=3) at
Python/ceval.c:3584
#16 0x8565c in PyEval_EvalFrame (f=0xdef468) at Python/ceval.c:2163
#17 0x88458 in fast_function (func=0x3a9870, pp_stack=0x267f10, n=1, na=1,
nk=4629184)
at Python/ceval.c:3645
#18 0x8830c in call_function (pp_stack=0xfd109608, oparg=1) at
Python/ceval.c:3584
#19 0x8565c in PyEval_EvalFrame (f=0x267db0) at Python/ceval.c:2163
#20 0x88458 in fast_function (func=0x3a96f0, pp_stack=0x251920, n=1, na=1,
nk=4629184)
at Python/ceval.c:3645
#21 0x8830c in call_function (pp_stack=0xfd1097d0, oparg=1) at
Python/ceval.c:3584
#22 0x8565c in PyEval_EvalFrame (f=0x2517c0) at Python/ceval.c:2163
#23 0x86b14 in PyEval_EvalCodeEx (co=0x1ca860, globals=0x0,
locals=0x2517c0, args=0x408b7c, argcount=1,
kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at
Python/ceval.c:2736
#24 0xda520 in function_call (func=0x1d2bb0, arg=0x408b70, kw=0x0) at
Objects/funcobject.c:548
#25 0x26028 in PyObject_Call (func=0x1d2bb0, arg=0x408b70, kw=0x0) at
Objects/abstract.c:1795
#26 0x2e088 in instancemethod_call (func=0x1d2bb0, arg=0x408b70, kw=0x0) at
Objects/classobject.c:2447
#27 0x26028 in PyObject_Call (func=0x1d2bb0, arg=0x408b70, kw=0x0) at
Objects/abstract.c:1795
#28 0x8794c in PyEval_CallObjectWithKeywords (func=0x1c61c0, arg=0x12f030,
kw=0x0) at Python/ceval.c:3430
#29 0xb7120 in t_bootstrap (boot_raw=0xbe77a0) at
./Modules/threadmodule.c:434
(gdb)
(gdb) up
#1 0xfe0a80ac in __pyx_f_5etree_25ElementDepthFirstIterator___next__
(__pyx_v_self=0x3ff8a0)
at src/lxml/etree.c:9081
9081 __pyx_2 = ((PyObject
*)__pyx_f_5etree__elementFactory(__pyx_v_current_node->_doc,__pyx_v_c_node));
if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; goto
__pyx_L1;}
(gdb)
#2 0x3b35c in listextend (self=0xdb0558, b=0xdd6fd0) at
Objects/listobject.c:825
825 }
(gdb) p *((struct LxmlNodeBase*)(b))->_c_node
$70 = {
_private = 0xdd6fd0,
type = XML_ELEMENT_NODE,
name = 0xc0a4b3 "TIMACT",
children = 0xdf5b20,
last = 0xdf5b20,
parent = 0xc0e4b8,
next = 0x0,
prev = 0xdf5b20,
doc = 0xc49aa0,
ns = 0x0,
content = 0x0,
properties = 0x0,
nsDef = 0x0,
psvi = 0x0,
line = 0,
extra = 0
}
(gdb) p self
$71 = (PyListObject *) 0xdb0558
(gdb) down
#1 0xfe0a80ac in __pyx_f_5etree_25ElementDepthFirstIterator___next__
(__pyx_v_self=0x3ff8a0)
at src/lxml/etree.c:9081
9081 __pyx_2 = ((PyObject
*)__pyx_f_5etree__elementFactory(__pyx_v_current_node->_doc,__pyx_v_c_node));
if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; goto
__pyx_L1;}
(gdb) p __pyx_v_current_node->_doc
$72 = (struct LxmlDocument * ?) 0x4053a0
(gdb) p *__pyx_v_current_node->_doc
$73 = {
ob_refcnt = 9,
ob_type = 0xfe13a460,
__pyx_vtab = 0xfe1474e0,
_ns_counter = 0,
_c_doc = 0xc49aa0,
_parser = 0x298970
}
(gdb) p *__pyx_v_c_node
$74 = {
_private = 0xdd6fd0,
type = XML_ELEMENT_NODE,
name = 0xc0a4b3 "TIMACT",
children = 0xdf5b20,
last = 0xdf5b20,
parent = 0xc0e4b8,
next = 0x0,
prev = 0xdf5b20,
doc = 0xc49aa0,
ns = 0x0,
content = 0x0,
properties = 0x0,
nsDef = 0x0,
psvi = 0x0,
line = 0,
extra = 0
}
(gdb) p *__pyx_v_c_node->children
$75 = {
_private = 0x0,
type = XML_TEXT_NODE,
name = 0xfdf9e050 "text",
children = 0x0,
last = 0x0,
parent = 0xc0e4b8,
next = 0xdef3e0,
prev = 0x0,
doc = 0xc49aa0,
ns = 0x0,
content = 0xe030c8 "09:26",
properties = 0x0,
nsDef = 0x0,
psvi = 0x0,
line = 0,
extra = 0
}
(gdb) p __pyx_v_c_node
$76 = (xmlNode *) 0xdef3e0
(gdb) p *__pyx_v_c_node->children->next
$77 = {
_private = 0xdd6fd0,
type = XML_ELEMENT_NODE,
name = 0xc0a4b3 "TIMACT",
children = 0xdf5b20,
last = 0xdf5b20,
parent = 0xc0e4b8,
next = 0x0,
prev = 0xdf5b20,
doc = 0xc49aa0,
ns = 0x0,
content = 0x0,
properties = 0x0,
nsDef = 0x0,
psvi = 0x0,
line = 0,
extra = 0
}
(gdb) p (__pyx_v_c_node->children->next == __pyx_v_c_node)
$78 = 1
(gdb)
Note how the __pyx_v_c_node holds a reference to itself in
__pyx_v_c_node->children->next
(which I guess should never happen)
How come this situation arises is currently a mystery to me.
Although this is a threaded program now all my threads deepcopy any
Elements they get presented,
before doing anything with them.
Still searching, 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.
Landesbank Baden-Württemberg
Anstalt des öffentlichen Rechts
Hauptsitze: Stuttgart, Karlsruhe, Mannheim