Comment 23 for bug 1185701

Revision history for this message
In , Daniel (daniel-redhat-bugs) wrote :

I have tried debugging it with python-lxml-2.3.5-1.fc17

apparently hitting line 601 of
https://github.com/lxml/lxml/blob/master/src/lxml/parser.pxi

elif ctxt.lastError.message is not NULL:
...
raise XMLSyntaxError(message, code, line, column)

end bar
end foo
end bar
end foo
end metadata
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "iterparse.pxi", line 491, in lxml.etree.iterparse.__next__ (src/lxml/lxml.etree.c:103790)
  File "iterparse.pxi", line 543, in lxml.etree.iterparse._read_more_events (src/lxml/lxml.etree.c:104333)
  File "parser.pxi", line 601, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:79743)
lxml.etree.XMLSyntaxError: None
>>>
Program received signal SIGINT, Interrupt.
0x000000360b8ea9d3 in __select_nocancel ()
    at ../sysdeps/unix/syscall-template.S:82
82 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
(gdb) b _raiseParseError
Function "_raiseParseError" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) l src/lxml/lxml.etree.c:79743
79738 __Pyx_GOTREF(__pyx_t_8);
79739 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
79740 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
79741 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
79742 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
79743 {__pyx_filename = __pyx_f[3]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79744 }
79745 __pyx_L3:;
79746
79747 __pyx_r = 0;
(gdb) src/lxml/lxml.etree.c:79700
Undefined command: "src". Try "help".
(gdb) l src/lxml/lxml.etree.c:79700
79695 __Pyx_GIVEREF(__pyx_t_4);
79696 PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
79697 __Pyx_GIVEREF(__pyx_t_7);
79698 __pyx_t_5 = 0;
79699 __pyx_t_4 = 0;
79700 __pyx_t_7 = 0;
79701 __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79702 __Pyx_GOTREF(__pyx_t_7);
79703 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
79704 __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
(gdb)
79705 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
79706 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
79707 {__pyx_filename = __pyx_f[3]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79708 goto __pyx_L3;
79709 }
79710 /*else*/ {
79711
79712 /* "/builddir/build/BUILD/lxml-2.3.5/src/lxml/parser.pxi":601
79713 * raise XMLSyntaxError(message, code, line, column)
79714 * else:
(gdb)
79715 * raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0) # <<<<<<<<<<<<<<
79716 *
79717 * cdef xmlDoc* _handleParseResult(_ParserContext context,
79718 */
79719 __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__XMLSyntaxError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79720 __Pyx_GOTREF(__pyx_t_7);
79721 __pyx_t_8 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79722 __Pyx_GOTREF(__pyx_t_8);
79723 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79724 __Pyx_GOTREF(__pyx_t_6);
(gdb)

  I really can't make sense of that generated code but it looks like to
me that lxml takes the wrong way to try to detect a parser error, there
isn't really any but its detection fails and it stop reporting a non
existent error.

  Still seems to me to be on lxml side...

Daniel