Something seems to have gone wrong with the java extensions and graphics where the following document will hang with both saxon & xalan when "use.extensions" is turned on (and the classpath has the relevant docbook extensions in it)
<?xml version="1.0"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0">
<title>foo</title>
<chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="chapter01" xml:base="chapter01/chapter01.xml">
<info>
<title>chapter</title>
</info>
<section>
<info>
<title>section</title>
</info>
<figure>
<info>
<title>title</title></info>
<mediaobject>
<imageobject role="html">
<imagedata fileref="chapter01/figures/masking.png" format="PNG"/>
</imageobject>
</mediaobject>
</figure>
</section>
</chapter>
</book>
What happens is that everything seems to process, but then saxon/xalan just hangs there doing nothing.
$ java -classpath "../xalan/xalan.jar:../xalan/xercesImpl.jar:../xalan/xml-apis.jar:../docbook-xsl-ns-1.79.0/extensions/xalan27.jar" org.ache.xalan.xslt.Process -in ./in.xml -xsl ../in.xsl -param use.extensions 1
file:///.../docbook-xsl-ns-1.79.0/xhtml/chunker.xsl; Line #106; Column #18; Writing chapter01.html for chapter(chapter01)
file:///.../docbook-xsl-ns-1.79.0/xhtml/chunker.xsl; Line #106; Column #18; Writing index.html for book
<?xml version="1.0" encoding="UTF-8"?>
It seems to be something to do with graphics extensions because it's the "mediaobject" that induces this behaviour. Since it happens with saxon (6.5) and xalan (2.7) the common thing seems to be the docbook extensions.
java version is
$ java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
Hi, I'm not able to duplicate this problem. I used the same xalan command line you provided except for -xsl ../docbook-xsl-ns-1.79.1/xhtml/chunk.xsl (you didn't specify what was in your in.xsl file), and the two chunks are created, the PI is emitted, and the process terminates normally. My java version is:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
I don't recall any changes to the extension code in either Java or XSL for this release. Did it work for you using 1.78.1? What is in "in.xsl"?
I notice that the two chunks are actually created for you, as well as the PI, so I don't see anything going wrong with the XSL processing itself.
I've attached what I can use to replicate it
Included is the jstack logs from both saxon & xalan which both looks similar with a seeming unending wait on a conditional?
I also just tried with 1.78.1 and the same thing happens
This might be a problem with the jre itself. I installed "openjdk-8-jre", and it seems to work (i.e. exits correctly). This is with
Last edit: Ian Wienand 2015-12-29
Very strange. That does sound like it could be an OpenJDK bug. I guess. I notice that the problem also occurs in sun.misc.Unsafe and I seem to recall that there was some discussion recently about removing that class.
Did you compile the extension functions with that version of the JDK or are you using release jars?
This was using the extensions from the release jar files
So all signs point to the jdk ... i had no reason to be using 1.7 other than I hadn't upgraded the system to 1.8. Possibly it's a true race condition in the code, only hit on 1.7 for whatever reason. As mentioned, it would seem to be something in the image processing code, as it is the presence of the <mediaobject> tag that caused the hang across both saxon & xalan</mediaobject>