[pypy-dev] Looking for clues to consistent Seg Fault in PyPy 2.6.1

Jeff Doran jdoran at lexmachina.com
Sun Oct 11 00:28:16 CEST 2015


Hi,

I've run out of options trying to find a Seg Fault which happens when
running lxml under PyPy 2.6.1.  This problem only occurs under PyPy as
the rest of the code works fine under CPython 2.7.   I've been in
contact with the lxml dev team and they confirmed my problem, but
could not determine where the cause of the Seg Fault lies.   They
suggested reaching out to you folks for ideas or a possible work
around as the stack trace is always in libpypy-c.so and seems to be
triggered by eventual garbage collection.

Below is the gist of the email I sent to the lxml team earlier.  It
describes my ability to reproduce this Seg Fault using their supplied
test suite.  As of this writing, lxml is at version 3.5.0b1.   I'd
appreciate any feedback you might supply on how to deal with this
error.  Seg Faults are notoriously hard to find since they inevitably
happen upstream for the crash.

We are anxious to perform a complete evaluation of transitioning to
PyPy as our Python platform of choice and this appears to be the last
major blockage.


Thanks for your help.


- Jeff Doran

----------------


I'm running the lxml test suite under PyPy which I installed from
here,https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-2.6.1-linux_x86_64-portable.tar.bz2
.

I've downloaded the current lxml src from https://github.com/lxml/lxml.
I built lxml using  'python setup.py build --with-cython'
*From ..lxml/src/lxml  I run:
*
nosetests  -v --pdb --nocapture
Comparing with ElementTree 1.3.0
Comparing with cElementTree 1.3.0

TESTED VERSION: 3.5.0.beta1
    Python:           (major=2, minor=7, micro=10, releaselevel='final',
serial=42)
    lxml.etree:       (3, 5, 0, -99)
    libxml used:      (2, 8, 0)
    libxml compiled:  (2, 8, 0)
    libxslt used:     (1, 1, 26)
    libxslt compiled: (1, 1, 26)

lxml.html.tests.test_autolink.test_suite ... ok
lxml.html.tests.test_basic.test_suite ... ok
test_allow_tags (lxml.html.tests.test_clean.CleanerTest) ... ok
test_clean_invalid_root_tag (lxml.html.tests.test_clean.CleanerTest) ... ok
test_safe_attrs_excluded (lxml.html.tests.test_clean.CleanerTest) ... ok
test_safe_attrs_included (lxml.html.tests.test_clean.CleanerTest) ... ok
lxml.html.tests.test_clean.test_suite ... ok
lxml.html.tests.test_diff.test_suite ... ok
test_body (lxml.html.tests.test_elementsoup.SoupParserTestCase) ... ok
test_broken_attribute (lxml.html.tests.test_elementsoup.SoupParserTestCase)
... fish: Job 1, “nosetests  -v --pdb --nocapture” terminated by signal
SIGSEGV (Address boundary error)
```

Running these tests under gdb reveals the following partial stack trace:


#0  0x00007ffff57fa08a in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#1  0x00007ffff57fa110 in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#2  0x00007ffff5776be3 in PyPyWeakref_LockObject ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#3  0x00007ffff0337399 in __pyx_f_4lxml_5etree__isProxyAliveInPypy.isra.265 ()
   from /home/jeff/lxml/src/lxml/etree.pypy-26.so
#4  0x00007ffff033fbfb in __pyx_f_4lxml_5etree_attemptDeallocation ()
   from /home/jeff/lxml/src/lxml/etree.pypy-26.so
#5  0x00007ffff033fd70 in __pyx_tp_dealloc_4lxml_5etree__Element ()
   from /home/jeff/lxml/src/lxml/etree.pypy-26.so
#6  0x00007ffff62186f9 in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#7  0x00007ffff57aec90 in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#8  0x00007ffff57fa670 in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#9  0x00007ffff5fa0da8 in ?? ()
   from /home/jeff/debian_pypy_env/bin/libpypy-c.so
#10 0x00007ffff5f89a31 in ?? ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20151010/16d56e96/attachment.html>


More information about the pypy-dev mailing list