Libxml2 and libxslt issues

ViAdCk

Verified User
Joined
Feb 14, 2005
Messages
271
Hello,

A couple of days ago we libxml2 and libxslt were updated on one of our servers, causing issues apparently with the dompdf library in a wordpress plugin.

We have downgraded libxml2 with custombuild from version 2.9.5 to 2.9.4 and libxslt from version 1.1.30 to 1.1.29 but this hasn't solved the issue. When we run a phpinfo we see the following information:

Code:
XSL 	enabled
libxslt Version 	1.1.30
libxslt compiled against libxml Version 	2.9.4
EXSLT 	enabled
libexslt Version 	1.1.29
For some reason it appears that libxslt is still running on version 1.1.30 even after recompiling php various times.

Any idea how we can downgrade libxslt back to 1.1.29 and see if this resolves the dompdf problem?

Thanks in advance!
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,517
Location
Maastricht
I just upgraded, I don't know if this might have anything to do with it, but this warning occurred:
Code:
In file included from xpath.c:468:
timsort.h: In function 'libxml_domnode_tim_sort_collapse':
timsort.h:405: warning: comparison between signed and unsigned integer expressions
xpath.c: In function 'xmlXPathRegisterFuncNS__internal_alias':
xpath.c:4889: warning: ISO C forbids passing argument 4 of 'xmlHashAddEntry2__internal_alias' between function pointer and 'void *'
elfgcchack.h:4269: note: expected 'void *' but argument is of type 'xmlXPathFunction'
xpath.c: In function 'xmlXPathFunctionLookupNS__internal_alias':
xpath.c:4970: warning: ISO C forbids assignment between function pointer and 'void *'
xpath.c: At top level:
trionan.c:218: warning: 'trio_is_negative' defined but not used
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,560
I have upgraded libxml2 and libxslt on my servers, but did not see any propblems. Are you sure you upgraded them in the correct order? It is important to upgrade libxml2 first, and then libxslt. By the way my servers is on CentOS 7.4
 

BBM

Verified User
Joined
Jun 8, 2013
Messages
342
Location
Dutch Mountains
I updated both, each seperatly, but apparently in the wrong order, as there was a notice/warning about that.
So I rebuild the other again without any issues as of yet.

I wonder, when I would do "./build update all"... Does Custombuild know which lib* to build first?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,517
Location
Maastricht
Are you sure you upgraded them in the correct order?
I just did a ./build update and ./build update_versions as always. Then the error which I placed occurs automatically.
But I did not get a notice about a wrong order so I think my error has nothing to do with an incorrect order of updating, correct?
 

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
436
Location
Arnhem, NL
I received this warning;

Done libxml2. It is recommended to reinstall libxslt after update of libxml2.
It's not in bold or anything so very easy to miss. I also did update_versions this time (almost every time I do it manually) and the updates were installed in the wrong order. So CB doesn't manage the order of the updates because libxslt got installed first and then libxml2. So I needed to recompile libxslt a second time.
 

toktokcity

Verified User
Joined
Apr 29, 2016
Messages
32
Think I am having the same issue, this is the error:

Fatal error: Uncaught Dompdf\Exception: No block-level parent found. Not good.
If there is somebody who could explain how to downgrade libxml2 successfully, please share.
 
Last edited:

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,517
Location
Maastricht
I also did update_versions this time (almost every time I do it manually) and the updates were installed in the wrong order.
Oh that's odd, I did not get that notice you got as far as I remember.

I did a ./build libxslt now to be sure, but then I get this IO error:
Code:
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
./xsltproc.xml:8: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
]>
  ^
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
error
xsltParseStylesheetFile : cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
compilation error: file ./xsltproc.xml line 10 element refentry
xsltParseStylesheetProcess : document is not a stylesheet
make[2]: [xsltproc.1] Error 5 (ignored)
Luckily this is only docs so the rest compiled fine.
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
282
Problems with downgrading
What i did:
Customize versions in CS to the old version
Afther that i hot the downgrade button in CS to revert the update i made:
libXSLT
libXSLT 1.1.29
libXML2
libXML2 2.9.4

After that /.build php n
no problems but when i look at php info:

xml
XML Support active
XML Namespace Support active
libxml2 Version 2.9.4

xmlreader
XMLReader enabled
xmlwriter
XMLWriter enabled

xsl
XSL enabled
libxslt Version 1.1.30
libxslt compiled against libxml Version 2.9.5
EXSLT enabled
libexslt Version 1.1.29

So it seems that there are 2 versions of libxslt ? and complied against 2.9.5? why ? i did a downgrade right

Please help me on this because there is a important software on the server that make use of dompdf to generate pdf

Thank you

EDIT:

Things getting weird but after ./build apache dompdf suddenly works
 
Last edited:

tlweb

Verified User
Joined
Feb 23, 2015
Messages
14
Location
Netherlands
I have the same problem but i can't seem to get my libxslt down to 1.2.9.

XSL enabled
libxslt Version 1.1.30
libxslt compiled against libxml Version 2.9.4
EXSLT enabled
libexslt Version 1.1.29

I did a custom version downgrade through custombuild and that worked fine. did several rebuilds of both php 5.6 and 7.0 and apache but to no avail.

Hope someone have a clear solution on how to properly downgrade these libraries and what to do after the downgrade.
 

Arieh

Verified User
Joined
May 27, 2008
Messages
1,206
Location
The Netherlands
I'm also using dompdf on an important website. I rather not make that modification with removing whitespaces with that regex, I think it may cause unexpected behavior.

Is this upgrade for libxml2/xslt required at this moment? I rather wait until there is a more decent solution.
 

tlweb

Verified User
Joined
Feb 23, 2015
Messages
14
Location
Netherlands
I'm also using dompdf on an important website.
I fixed the problem by setting DOMPDF to parse the HTML using the HTML5 parser. By uploading a dompdf_config.custom.inc.php to the dompdf directory and set

PHP:
define("DOMPDF_ENABLE_HTML5PARSER", true);
Hope this helps anybody having this issue. It's been a very nasty one for me that cost me a whole day and a lot of extra gray hairs to fix.
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,560
Did anyone try the new libxml2 2.9.6 version, if that fixes the problems mentioned?
 

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
436
Location
Arnhem, NL
Regarding the order of compiling:

I wonder, when I would do "./build update all"... Does Custombuild know which lib* to build first?
I just updated to libxml 2.9.7 & libxslt 1.1.32 and when you use ./build update_versions the order of compiling is now correct;

Done libxml2. It is recommended to reinstall libxslt after update of libxml2.
Updating libxslt
Found /usr/local/directadmin/custombuild/libxslt-1.1.32.tar.gz
 

toktokcity

Verified User
Joined
Apr 29, 2016
Messages
32
Or, when using Custombuild, make sure to work with version 1752 which fixes a building problem in 1751 for libxslt.
 

rnbwkat

Verified User
Joined
May 3, 2016
Messages
17
still having this problem... What is fix?

Still getting this and not sure what the fix is :

preproc.c:2366: error: too many arguments to function 'xsltPreComputeExtModuleElement'
preproc.c:2373: error: 'xsltExtMarker' undeclared (first use in this function)
make[2]: *** [pattern.lo] Error 1
make[2]: *** [preproc.lo] Error 1
make[2]: Leaving directory `/usr/local/directadmin/custombuild/libxslt-1.1.32/libxslt'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/directadmin/custombuild/libxslt-1.1.32'
make: *** [all] Error 2

Running on :
Compiled on CentOS 6.0 64-Bit
Compile Date Oct 20 2017, 15:53:51
Server Version 1.52.1
 

grpooja

New member
Joined
Dec 26, 2019
Messages
1
we are using libxml2-2.9.8 and we found coverity issuse for below code
): Recursion in included headers (PW.INCLUDE_RECURSION)
1. include_recursion: #include file "/var/lib/jenkins/coma/coma_libs_linux/libxml2-2.9.8-inst/include/libxml2/libxml/globals.h" includes itself: globals.h -> threads.h -> globals.h
35#include <libxml/globals.h>
anyone faced this issuse
 
Top