[lxml-dev] Segfault on OS X
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
I did both against the lxml trunk. On OS X it is Python2 .3.5, on Debian, 2.4.x. Is there some special voo-doo I should when closing a parsed document to re-open it? --Paul
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
I did both against the lxml trunk. On OS X it is Python2 .3.5, on Debian, 2.4.x.
Is there some special voo-doo I should when closing a parsed document to re-open it?
This ought to just work. Special voo-doo is not the lxml way, if we can help it. What versions of libxml2 (and libxslt) are you using on the two platforms? I'll do some investigations on Linux with valgrind to see whether I can find any peculiarities going on with this scenario. If not, then we're going to have a debugging challenge on our hands.. Regards, Martijn
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
Another question: is the Ubuntu running on the same hardware or is this different hardware? I'm trying to figure out whether it's the powerpc that's somehow exposing a bug in the code, or whether there's something else going on, on the library level. If the ubuntu is indeed installed on PowerPC, then it's more likely it's a library issue somewhere. Regards, Martijn
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
Paul, this might have to do with compilation issues. Can you do a svn up on your Mac OS X box, do a 'make clean', and recompiling/reinstalling? Regards, Martijn
Sorry, just finished my talks today in Ireland. I agree that Marc's analysis is most likely correct for me too. BTW, I'm using a Python and a libxml2 from DarwinPorts. --Paul On Apr 14, 2005, at 12:53 PM, Martijn Faassen wrote:
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
Paul, this might have to do with compilation issues. Can you do a svn up on your Mac OS X box, do a 'make clean', and recompiling/reinstalling?
Regards,
Martijn
Alas, still a segfault. --Paul On Apr 14, 2005, at 12:53 PM, Martijn Faassen wrote:
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
Paul, this might have to do with compilation issues. Can you do a svn up on your Mac OS X box, do a 'make clean', and recompiling/reinstalling?
Regards,
Martijn
Paul Everitt wrote:
Hi all. The following produces a segfault on OS X but not on Ubuntu:
from lxml import etree f = open("../data/tmp/content.xml", "r") content = etree.parse(f) f.close() del f, content f = open("../data/tmp/content.xml", "r") content = etree.parse(f) Segmentation fault
Just for the record: I tried lxml on OSX 10.3.8, DarwinPort's python 2.4, libxslt, libxml and it worked perfectly (the above test as well as the unit tests... Philipp
participants (3)
-
Martijn Faassen
-
Paul Everitt
-
Philipp von Weitershausen