You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by ray dhurandhar <ra...@gmail.com> on 2010/03/13 23:10:53 UTC

Trace/BPT trap with PDFBox when running inside tomcat 6.0.20

Hi,
I am getting a Trace/BPT trap when invoking pdfbox to convert a pdf to an
image
inside a web application, running inside a Tomcat 6.0.20 container.
The result is that Tomcat and the JVM crash completely and the process
quits.
I get the exact result with jetty. The pdfbox invocation code is:

            String[] args = new String[] {"-imageType", "png", "-startPage",
"1", "-endPage", "1", tmp_filename};
            org.apache.pdfbox.PDFToImage.main(args);

It is a strange error, because it happens repeatably on a specific PDF file
(works fine on others) in my
actual codebase, but when I made a standalone jsp page to run the same code
on the same file
it works fine and generates a png. So in some situations pdfbox is tickling
the Java VM in a way that
it doesn't like. This is on Mac OS Snow Leopard, Java 1.6.0_17.
I haven't tried other platforms yet because I don't have easy access to a
windows/linux machine.

Has anyone seen anything like this ? any suggestions to workaround ?
the debug trace is below:

PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: PDFOperator{RG}
PDFStreamEngine DEBUG - token: PDFOperator{RG}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: PDFOperator{rg}
PDFStreamEngine DEBUG - token: PDFOperator{rg}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{BT}
PDFStreamEngine DEBUG - token: PDFOperator{BT}
PDFStreamEngine DEBUG - token: COSName{R7}
PDFStreamEngine DEBUG - token: COSName{R7}
PDFStreamEngine DEBUG - token: COSInt{24}
PDFStreamEngine DEBUG - token: COSInt{24}
PDFStreamEngine DEBUG - token: PDFOperator{Tf}
PDFStreamEngine DEBUG - token: PDFOperator{Tf}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSFloat{89.9981}
PDFStreamEngine DEBUG - token: COSFloat{89.9981}
PDFStreamEngine DEBUG - token: COSFloat{697.641}
PDFStreamEngine DEBUG - token: COSFloat{697.641}
PDFStreamEngine DEBUG - token: PDFOperator{Tm}
PDFStreamEngine DEBUG - token: PDFOperator{Tm}
PDFStreamEngine DEBUG - token: COSArray{[COSString{I}, COSInt{-1},
COSString{n}, COSInt{1}, COSString{c}, COSInt{-1}, COSString{or},
COSInt{-1}, COSString{p}, COSInt{1}, COSString{or}, COSInt{-1},
COSString{at}, COSInt{-2}, COSString{i}, COSInt{-2}, COSString{on},
COSInt{1}, COSString{ B}, COSInt{2}, COSString{l}, COSInt{-2},
COSString{og.c}, COSInt{-1}, COSString{om}, COSInt{833}]}
PDFStreamEngine DEBUG - token: COSArray{[COSString{I}, COSInt{-1},
COSString{n}, COSInt{1}, COSString{c}, COSInt{-1}, COSString{or},
COSInt{-1}, COSString{p}, COSInt{1}, COSString{or}, COSInt{-1},
COSString{at}, COSInt{-2}, COSString{i}, COSInt{-2}, COSString{on},
COSInt{1}, COSString{ B}, COSInt{2}, COSString{l}, COSInt{-2},
COSString{og.c}, COSInt{-1}, COSString{om}, COSInt{833}]}
<Java process crashes here>


thanks, Ray.

Fwd: Trace/BPT trap with PDFBox when running inside tomcat 6.0.20

Posted by ray dhurandhar <ra...@gmail.com>.
Hi,
I am getting a Trace/BPT trap when invoking pdfbox to convert a pdf to an
image
inside a web application, running inside a Tomcat 6.0.20 container.
The result is that Tomcat and the JVM crash completely and the process
quits.
I get the exact result with jetty. The pdfbox invocation code is:

            String[] args = new String[] {"-imageType", "png", "-startPage",
"1", "-endPage", "1", tmp_filename};
            org.apache.pdfbox.PDFToImage.main(args);

It is a strange error, because it happens repeatably on a specific PDF file
(works fine on others) in my
actual codebase, but when I made a standalone jsp page to run the same code
on the same file
it works fine and generates a png. So in some situations pdfbox is tickling
the Java VM in a way that
it doesn't like. This is on Mac OS Snow Leopard, Java 1.6.0_17.
I haven't tried other platforms yet because I don't have easy access to a
windows/linux machine.

Has anyone seen anything like this ? any suggestions to workaround ?
the debug trace is below:

PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSFloat{0.12}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: PDFOperator{RG}
PDFStreamEngine DEBUG - token: PDFOperator{RG}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: PDFOperator{rg}
PDFStreamEngine DEBUG - token: PDFOperator{rg}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: PDFOperator{q}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSFloat{8.33333}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{cm}
PDFStreamEngine DEBUG - token: PDFOperator{BT}
PDFStreamEngine DEBUG - token: PDFOperator{BT}
PDFStreamEngine DEBUG - token: COSName{R7}
PDFStreamEngine DEBUG - token: COSName{R7}
PDFStreamEngine DEBUG - token: COSInt{24}
PDFStreamEngine DEBUG - token: COSInt{24}
PDFStreamEngine DEBUG - token: PDFOperator{Tf}
PDFStreamEngine DEBUG - token: PDFOperator{Tf}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{0}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSInt{1}
PDFStreamEngine DEBUG - token: COSFloat{89.9981}
PDFStreamEngine DEBUG - token: COSFloat{89.9981}
PDFStreamEngine DEBUG - token: COSFloat{697.641}
PDFStreamEngine DEBUG - token: COSFloat{697.641}
PDFStreamEngine DEBUG - token: PDFOperator{Tm}
PDFStreamEngine DEBUG - token: PDFOperator{Tm}
PDFStreamEngine DEBUG - token: COSArray{[COSString{I}, COSInt{-1},
COSString{n}, COSInt{1}, COSString{c}, COSInt{-1}, COSString{or},
COSInt{-1}, COSString{p}, COSInt{1}, COSString{or}, COSInt{-1},
COSString{at}, COSInt{-2}, COSString{i}, COSInt{-2}, COSString{on},
COSInt{1}, COSString{ B}, COSInt{2}, COSString{l}, COSInt{-2},
COSString{og.c}, COSInt{-1}, COSString{om}, COSInt{833}]}
PDFStreamEngine DEBUG - token: COSArray{[COSString{I}, COSInt{-1},
COSString{n}, COSInt{1}, COSString{c}, COSInt{-1}, COSString{or},
COSInt{-1}, COSString{p}, COSInt{1}, COSString{or}, COSInt{-1},
COSString{at}, COSInt{-2}, COSString{i}, COSInt{-2}, COSString{on},
COSInt{1}, COSString{ B}, COSInt{2}, COSString{l}, COSInt{-2},
COSString{og.c}, COSInt{-1}, COSString{om}, COSInt{833}]}
<Java process crashes here>


thanks, Ray.