Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#15263 closed defect (fixed)

php5: dyld confused about multiple installed libxml2 versions

Reported by: bkw (Bernhard Weisshuhn (a.k.a. bernhorst)) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: php5, libxml2, dyld Cc: ryandesign (Ryan Carsten Schmidt), jyrkiwahlstedt
Port:

Description

this might be a similar issue like #14063.

Recent libxml2 versions have much improved schema validation functionality over the one shipped with leopard does. But Dyld seems to think they are interchangable, based on the compatibilty version 9.0.0. I upgraded everything from macports (apache2, libxml2, php5) but still see the old library at work. Validating an xml file against a schema gives the following error message:

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Unimplemented block at /SourceCache/libxml2/libxml2-17.7.6/libxml2/pattern.c:851 in [...]/tests/xmllib2.php on line 10

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Unimplemented block at /SourceCache/libxml2/libxml2-17.7.6/libxml2/pattern.c:851 in [...]/tests/xmllib2.php on line 10

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Internal error: xmlSchemaIDCAddStateObject, failed to create an XPath validation context. in [...]/tests/xmllib2.php on line 10

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Internal error: xmlSchemaValidateElem, calling xmlSchemaValidateElemDecl(). in [...]/tests/xmllib2.php on line 10

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Internal error: xmlSchemaDocWalk, calling xmlSchemaValidateElem(). in [...]/tests/xmllib2.php on line 10

Note the mention of libxml2-17.7.6, I have 2.6.63 installed, which phpinfo() also cofirms. I don't even have a /SourceCache directory!

Also the httpd backend crashes with a malloc error (non-aligned pointer beeing freed).

During my investigaion I cooked all kinds of php versions on my own, experimenting with all kinds of ld-options like -force_flat_namespace, but always had similar results. phpinfo() pretends to use version 2.6.32 from /opt/local/lib, but in reality leopard's version from /usr/lib is beeing used. One Combination (iirc it was with suhoshin and xdebug linked in) produced a crash-reporter dump, that actually showed both versions of libxml2 in memory.

php code to reproduce this problem is as easy as:

$dom = new DOMDocument;
$dom->load('somefile.xml');
$dom->schemaValidate('someschema.xsd');

Please mail me if you need more details, i can reproduce this all to easily.

Change History (8)

comment:1 Changed 17 years ago by bkw (Bernhard Weisshuhn (a.k.a. bernhorst))

btw, the php team rejected a (imho) similar bug as a build configuration issue: http://bugs.php.net/bug.php?id=43883

comment:2 Changed 17 years ago by jariberg@…

I solved this myself by changing --with-libxml-dir in the php5 Portfile and reinstalled php5 (did an uninstall, clean first)

edit: /opt/local/var/macports/sources/rsync.macports.org/release/ports/www/php5/Portfile
change: --with-libxml-dir=${prefix} to use the native libxml version by changing it to --with-libxml-dir=/usr

Remember to recompile and stop/start apache. It should now work!

comment:3 Changed 17 years ago by bkw (Bernhard Weisshuhn (a.k.a. bernhorst))

Thanks for the reply, but the whole point was to actually use the new and much improved functionality of the NEW libxml2 version. Any hints on that?

comment:4 Changed 16 years ago by jmroot (Joshua Root)

Has building libxml2 with two-level namespace helped with this? (#15750, r38015)

comment:5 in reply to:  4 ; Changed 16 years ago by bkw (Bernhard Weisshuhn (a.k.a. bernhorst))

Replying to jmr@macports.org:

Has building libxml2 with two-level namespace helped with this? (#15750, r38015)

Yes, it has! Thanks a bunch, ricci and jmr! You may close this ticket, I'm a happer camper now.

comment:6 in reply to:  5 Changed 16 years ago by bkw (Bernhard Weisshuhn (a.k.a. bernhorst))

Replying to bkw@weisshuhn.de:

Replying to jmr@macports.org:

Has building libxml2 with two-level namespace helped with this? (#15750, r38015)

Yes, it has! Thanks a bunch, ricci and jmr! You may close this ticket, I'm a happer camper now.

No, I don't know what a "happer" camper is either, and I guess I don't want to know. That's "happy" of course.

comment:7 in reply to:  5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to bkw@weisshuhn.de:

Replying to jmr@macports.org:

Has building libxml2 with two-level namespace helped with this? (#15750, r38015)

Yes, it has! Thanks a bunch, ricci and jmr! You may close this ticket, I'm a happer camper now.

Oh good!

comment:8 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.