I'm getting a similar segfault during the test_inplace rule, on lxml 2.4.3, python 3.6.6, on aarch64, compiled with gcc-8.2.0 on glibc-2.27. ... 1584/1822o(j86.9%):ttxtt(validation)ingios(...est_relaxng.ETreeRelaxNGTestCase) 1605/1822v(l88.1%):.txtt(sax)to_pulldoml(lxml.tests.test_sax.ETreeSaxTestCase)) 1611/1822s(x88.4%): txtt(validation)invalid_schema_namespace.(...atronTestCase) 1681/1822v(l92.3%):.txtt(validation)esolvers_rooto(...LSchemaResolversTestCase) 1734/1822v(l95.2%):.xpathx(...or)mpile_nst(...luator.ETreeETXPathClassTestCase) 1735/1822l(m95.2%):.txtt(xpathxslt)ator.xpath 1821/1822x(a99.9%):ttxtt(extensions)lement_raises(...reeXSLTExtElementTestCase) 1822/1822e(100.0%):.txt (xpathxslt) Doctest: xpathxslt.txt ---------------------------------------------------------------------- Ran 1822 tests in 95.962s OK Comparing with ElementTree 1.3.0 TESTED VERSION: 4.2.3 Python: sys.version_info(major=2, minor=7, micro=15, releaselevel='final', serial=0) lxml.etree: (4, 2, 3, 0) libxml used: (2, 9, 8) libxml compiled: (2, 9, 8) libxslt used: (1, 1, 32) libxslt compiled: (1, 1, 32) make[2]: *** [Makefile:71: test_inplace] Segmentation fault (core dumped) Note that I pulled in the change from https://mailman-mail5.webfaction.com/pipermail/lxml/20170113/015734.html, because the coverage report code took about an hour and sucked up ~2GB of memory, only to spit out a spurious error about the first "cimport" statement it found. The same segfault happens with or without that change though. My backtrace looks like this: #0 0x0000007f8ac12350 in PyDict_GetItem () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #1 0x0000007f8abfc24c in PyFrame_New () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #2 0x0000007f894975d8 in __Pyx_TraceSetupAndCall (code=code@entry=0x7f897cf518 <__pyx_frame_code.70765>, frame=frame@entry=0x7ff0a77c28, tstate=0x1d7032f0, funcname=funcname@entry=0x7f89745f48 "__dealloc__", srcfile=srcfile@entry=0x7f8973fbd8 "src/lxml/parser.pxi", firstlineno=firstlineno@entry=530) at src/lxml/etree.c:257932 type = value = traceback = retval = #3 0x0000007f894ef5e8 in __pyx_pf_4lxml_5etree_14_ParserContext_2__dealloc__ (__pyx_v_self=0x7f848b1750) at src/lxml/etree.c:114106 tstate = __pyx_frame = 0x0 __pyx_t_2 = __Pyx_use_tracing = 0 __pyx_t_1 = __pyx_t_3 = __pyx_frame_code = 0x7f84b3c4b0 __pyx_frame = __Pyx_use_tracing = __pyx_t_1 = __pyx_t_2 = __pyx_t_3 = tstate = state = tstate = ret = tstate = state = tstate = ret = ret = tstate = state = tstate = ret = ret = tstate = state = tstate = ret = ret = tstate = state = tstate = ret = ret = tstate = state = tstate = ret = ret = tstate = ---Type to continue, or q to quit--- state = tstate = ret = ret = tstate = state = tstate = ret = tstate = state = tstate = #4 __pyx_pw_4lxml_5etree_14_ParserContext_3__dealloc__ (__pyx_v_self=0x7f848b1750) at src/lxml/etree.c:48557 No locals. #5 __pyx_tp_dealloc_4lxml_5etree__ParserContext (o=0x7f848b1750) at src/lxml/etree.c:35990 etype = 0x0 eval = 0x0 etb = 0x0 p = 0x7f848b1750 #6 0x0000007f89468580 in __pyx_tp_dealloc_4lxml_5etree__BaseParser (o=0x7f852ee190) at src/lxml/etree.c:232721 _py_tmp = p = 0x7f852ee190 #7 0x0000007f85189edc in __pyx_module_cleanup (self=) at src/lxml/objectify.c:39696 _py_tmp = #8 __pyx_module_cleanup_atexit (module=, unused=) at src/lxml/objectify.c:43062 No locals. #9 0x0000007f8ac81c50 in PyEval_EvalFrameEx () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #10 0x0000007f8ac851d0 in PyEval_EvalCodeEx () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #11 0x0000007f8abfcc5c in ?? () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #12 0x0000007f8abd131c in PyObject_Call () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #13 0x0000007f8ac7b664 in PyEval_CallObjectWithKeywords () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #14 0x0000007f8acaac70 in Py_Finalize () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #15 0x0000007f8acaa658 in Py_Exit () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #16 0x0000007f8acaa740 in ?? () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #17 0x0000007f8acaa958 in PyErr_PrintEx () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #18 0x0000007f8acab4bc in PyRun_SimpleFileExFlags () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #19 0x0000007f8acbdf98 in Py_Main () from /usr/lib/aarch64-linux-gnu/libpython2.7.so.1.0 No symbol table info available. #20 0x0000007f8a91b8e4 in __libc_start_main () from /lib/aarch64-linux-gnu/libc.so.6 No symbol table info available. #21 0x0000000000400880 in _start () No symbol table info available. Backtrace stopped: previous frame identical to this frame (corrupt stack?)