6 months after and trying several versions of lxml we are still facing the issue.
I've checked for the system memory consumption as per your recommendation but everything looks fine to me, plenty of memory available, I don't see any process consuming abnormally.
I've found a way to "trigger" the issue everytime. If I use apache reload command or graceful stop, the issue occurs.
Feb 12 10:35:58 server1.capcl httpd: *** glibc detected *** /usr/sbin/apache2: munmap_chunk(): invalid pointer: 0x00007f9681b48f70 ***
Feb 12 10:35:58 server1.capcl httpd: ======= Backtrace: =========
Feb 12 10:35:58 server1.capcl httpd: /lib/libc.so.6(+0x78bb6)[0x7f967d830bb6]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(xmlResetError+0x34)[0x7f967a55c8e4]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(__xmlRaiseError+0x237)[0x7f967a55ddf7]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(__xmlSimpleError+0x6b)[0x7f967a55e42b]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(xmlBufferGrow+0xcd)[0x7f967a57b77d]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(xmlOutputBufferWriteEscape+0x2a8)[0x7f967a58b358]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x109093)[0x7f967a632093]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x10855d)[0x7f967a63155d]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x109093)[0x7f967a632093]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x10855d)[0x7f967a63155d]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x109093)[0x7f967a632093]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(+0x10855d)[0x7f967a63155d]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxml2.so.2(xmlNodeDumpOutput+0xd5)[0x7f967a633c95]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxslt.so.1(xsltSaveResultTo+0x330)[0x7f966c447ca0]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libxslt.so.1(xsltSaveResultToString+0xbb)[0x7f966c447f4b]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/python2.6/dist-packages/lxml/etree.so(+0x50587)[0x7f965e694587]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/python2.6/dist-packages/lxml/etree.so(+0x3b4b7)[0x7f965e67f4b7]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(_PyObject_Str+0x7b)[0x7f9675bdbf6b]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Str+0xa)[0x7f9675bdc06a]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0xa5277)[0x7f9675bea277]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0xad1a3)[0x7f9675bf21a3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f9675b954e3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x48e1)[0x7f9675c3a9e1]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5a98)[0x7f9675c3bb98]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x920)[0x7f9675c3cfd0]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0x7df90)[0x7f9675bc2f90]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f9675b954e3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x3adf)[0x7f9675c39bdf]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x920)[0x7f9675c3cfd0]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0x7df90)[0x7f9675bc2f90]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f9675b954e3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0x61f1f)[0x7f9675ba6f1f]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f9675b954e3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(+0xb692c)[0x7f9675bfb92c]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7f9675b954e3]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libpython2.6.so.1.0(PyEval_CallObjectWithKeywords+0x43)[0x7f9675c35403]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/apache2/modules/mod_wsgi.so(+0x12fdb)[0x7f9676008fdb]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/apache2/modules/mod_wsgi.so(+0x17eed)[0x7f967600deed]
Feb 12 10:35:58 server1.capcl httpd: /usr/lib/libapr-1.so.0(+0x29eb3)[0x7f967dd84eb3]
Feb 12 10:35:58 server1.capcl httpd: /lib/libpthread.so.0(+0x69ca)[0x7f967db449ca]
Feb 12 10:35:58 server1.capcl httpd: /lib/libc.so.6(clone+0x6d)[0x7f967d8a121d]
I'm considering rebuilding apache, mod_wsgi and lxml in debug mode, maybe I'll know more.
B.