[xml] Possible improvement for xmlCleanupParser



Hi there,

Would it be possible to include calls to xmlCleanupInputCallbacks() and xmlCleanupOutputCallbacks() in xmlCleanupParser()? That way, a user of the library who needs to reset everything would only have to make one cleanup call, not three.
Is there a reason for not making the two additional calls?


A friend here at work just debugged a hard to find problem with Apache 2 and the corresponding mod_perl and the XML::LibXML Perl module.
It was in the scheme match/open/close/read callback code / table.

mod_perl loads the module code and the libxml library gets initialized, including some perl-specific match/open/close/read callback pointers to code in the scheme handler table. Then for some reason mod_perl unloads the perl module (XS) code again and reloads it at a different location. The old pointers in the libxml tables are not cleared out by a call to xmlCleanupParser(), and the new (valid) ones which are registered a second time get added to the top of the table. Now, when some code tries to access a resource with e.g. file://, the code works its way down the stack to the corresponding (default) entry in that table, but it crashes before getting there because of the (now invalid) code pointers into the already unloaded module in the middle of the stack.





-Marc


_________________________________________________________________
Marc Liyanage                                        futureLAB AG

                                         phone:  +41 52 260 22 10
mliyanage futurelab ch                   fax:    +41 52 260 22 23
http://www.futurelab.ch                  mobile: +41 76 554 22 10
_________________________________________________________________




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