[lxml-dev] lxml \ libxslt \ libxml2 leads to apache 2 crash on freebsd/amd64

Dmitri Fedoruk dfedoruk at gmail.com
Sat Dec 29 17:48:36 CET 2007


Hi once again,

So, just to me more precise - iit is truly a deallocation problem of
libxml2 inside of Apache.

here is the code with debugging traces:
...
    result = ''
    try:
        result_tree = transform(data, **variables )
        logging.debug('try')
        if isText:
            result = str(result_tree)
        else:
            result =  etree.tostring(result_tree, encoding = 'utf-8')
        logging.debug('passed')

    except Exception, exc:
      inLogger.error(  exc.__str__() )
      inLogger.error(  "xslt error" )
      return ""

    logging.debug('fake object')
    result_tree = '1' # as well as None, etree.Element(), etc
    logging.debug('exiting')
    return result

Here is the log of the normal run:
Sat, 29 Dec 2007 19:42:38 DEBUG    try
Sat, 29 Dec 2007 19:42:38 DEBUG    passed
Sat, 29 Dec 2007 19:42:38 DEBUG    fake object
Sat, 29 Dec 2007 19:42:38 DEBUG    exiting

and here is the log of the crashing call:
Sat, 29 Dec 2007 19:42:37 DEBUG    try
Sat, 29 Dec 2007 19:42:37 DEBUG    passed
Sat, 29 Dec 2007 19:42:37 DEBUG    fake object
httpd in free(): error: modified (chunk-) pointer

So, it happens when I try to replace my result_tree value

Is it worth of reporting this crash to libxml2 / apache mailing lists,
what would you say?

Cheers,
Dmitri


More information about the lxml-dev mailing list