Re: [xml] libxml2/libxslt: global variables considered harmful



Daniel Veillard, 28.07.2010 11:53:
On Wed, Jul 14, 2010 at 02:07:42PM +0200, Michael Stahl wrote:
IMHO such a design would also be possible for libxml2/libxslt, but of
course this would be an incompatible interface change.
usually there isn't much enthusiasm for that kind of thing  :)

   Actually there is a bit of this already, see
     http://xmlsoft.org/html/libxml-globals.html#xmlGlobalState
it's stored in thread local variables, and access is redirected
via macros when compiling, it solves the problem in most cases but
not all cases. Plus that doesn't fix libxslt which is hit very hard
with the issue.

Same problem here. There were a couple of bug reports in the past regarding lxml's interaction with the original libxml2 Python bindings which often leads to crashes. The currently recommended way of working around this is to link lxml statically against its dependencies. Not a perfect solution, but a rather safe one.

Stefan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]