[issue16089] _elementtree causes segfault in GC

2012-10-02 Thread Stefan Krah
Stefan Krah added the comment: Nice find. -- The Python version does this: _Element = _ElementInterface = Element So (naively) I would think the same should be done for the C version after importing Element. But then one runs into the object layouts conflict that you mentioned. On the oth

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Eli Bendersky
Eli Bendersky added the comment: Thank you, Antoine, for looking into this. I wish I could participate in a meaningful way, but alas it will be days or weeks before I can recreate a suitable setup to get back hacking on Python. -- ___ Python tracker

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset f9224f23f473 by Antoine Pitrou in branch '3.3': Sanitize and modernize some of the _elementtree code (see issue #16089). http://hg.python.org/cpython/rev/f9224f23f473 New changeset 9fb0a8fc5d79 by Antoine Pitrou in branch 'default': Sanitize and mod

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'll still commit my cleanup patch in the meantime :-) -- ___ Python tracker ___ ___ Python-bugs-lis

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Example of this is the following code in treebuilder_handle_start: if (this != Py_None) { if (element_add_subelement((ElementObject*) this, node) < 0) goto error; (note the overly optimistic cast) but this is really a pervasive problem,

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, the problem is that _elementtree.TreeBuilder expects to receive _elementtree.Element instances, but simpleTAL's element_factory instead gives _ElementInterface instances. In other words, TreeBuilder is completely broken. -- __

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way, the crash involves an _ElementInterface subclass named SimpleElementTreeVar: #0 0x00524c0f in visit_decref (op=Traceback (most recent call last): File "/home/antoine/cpython/33/python-gdb.py", line 1298, in to_string pyop = PyObjectPt

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: More assorted celementtree cleanups. -- Added file: http://bugs.python.org/file27378/ctree2.patch ___ Python tracker ___ ___

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a collection of assorted small fixes for celementtree. There are probably other problems lurking (the coding style there is quite old). I cannot say anything about the crasher until there's a simple reproducer :) -- nosy: +pitrou Added file: ht

[issue16089] _elementtree causes segfault in GC

2012-10-01 Thread Georg Brandl
Georg Brandl added the comment: Let's make sure this gets into 3.3.1. -- priority: critical -> release blocker ___ Python tracker ___

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Stefan Krah
Stefan Krah added the comment: Do note that the patch is somewhat cargo-cult. I don't understand yet why it works; it may very well just silence the real problem. -- ___ Python tracker _

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Eli Bendersky
Eli Bendersky added the comment: I'm currently somewhat "offline" for a while (cross-continental move), but I'll do my best to try to recreate my setup to test this problem and the proposed solution. -- ___ Python tracker

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Christian Heimes
Christian Heimes added the comment: I can confirm that Stefan's fix works. I ran the SimpleTAL test suite about hundred times in a loop without a segfault. But I don't understand why the change fixes the issue. Could the alteration just lead to another code path so the erroneous code isn't tri

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Stefan Krah
Stefan Krah added the comment: I'm now able to reproduce the issue with a non-debug build. As Christian says, using Py_CLEAR() does not help (though I wonder if it shouldn't be used anyway). Reverting part of 20b8f0ee3d64 "fixes" the segfault, see the attached diff. I don't know the code well en

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Christian Heimes
Christian Heimes added the comment: No, it doesn't make a difference when I replace Py_XDECREF() with Py_CLEAR(). I've also replaced Py_(X)DECREF() in the other *_gc_clear() methods without success. -- ___ Python tracker

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Stefan Krah
Stefan Krah added the comment: I can't reproduce this, so just a wild guess: Does the segfault still happen if you replace Py_XDECREF() with Py_CLEAR() in xmlparser_gc_clear()? -- nosy: +skrah ___ Python tracker __

[issue16089] _elementtree causes segfault in GC

2012-09-30 Thread Florent Xicluna
Changes by Florent Xicluna : -- components: +XML nosy: +eli.bendersky, flox ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue16089] _elementtree causes segfault in GC

2012-09-29 Thread Christian Heimes
Christian Heimes added the comment: The issue could be related to #14007. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16089] _elementtree causes segfault in GC

2012-09-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue16089] _elementtree causes segfault in GC

2012-09-29 Thread Christian Heimes
New submission from Christian Heimes: The issue was reported by Arfrever on #python-dev. The test suite of simpletal [1] was segfaulting with Python 3.3. It doesn't segfault without the _elementtree C extension. I'm able to reproduce the issue. It may take a couple of runs with a debug build