[
https://issues.apache.org/jira/browse/PDFBOX-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16377593#comment-16377593
]
Tilman Hausherr edited comment on PDFBOX-4109 at 2/27/18 6:25 AM:
------------------------------------------------------------------
Yes, PDDocument has a static initialization since 2.0.5 that avoids the
deadlock by initializing one of the classes first. In 3.0 the problem is gone
because one of the classes is different.
The problem is that your test code isn't realistic, because usually in non test
code, one would access PDDocument before COSNumber / COSInteger.
was (Author: tilman):
Yes, PDDocument has a static initialization since 2.0.5 that avoids the
deadlock by initializing one of the classes first.
The problem is that your test code isn't realistic, because usually in non test
code, one would access PDDocument before COSNumber / COSInteger.
> Static Initialization Deadlock between COSNumber/COSInteger (2)
> ---------------------------------------------------------------
>
> Key: PDFBOX-4109
> URL: https://issues.apache.org/jira/browse/PDFBOX-4109
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.5, 2.0.8
> Reporter: Tilman Hausherr
> Priority: Major
>
> Written by [~jesmith3] in PDFBOX-3698:
> {code:java}
> public class PDFBox3698
> {
> public static void main(String[] args) throws ClassNotFoundException,
> InterruptedException
> {
> Thread thread = new Thread(new Runnable() {
> @Override
> public void run() {
> try {
> Class.forName(COSNumber.class.getName(), true,
> COSNumber.class.getClassLoader());
> } catch (ClassNotFoundException ex) {
> //
> }
> }
> });
> thread.start();
> Class.forName(COSInteger.class.getName(), true,
> COSInteger.class.getClassLoader());
> thread.join();
> }
> }
> {code}
> I was able to reproduce in 2.0.5 with a few executions.
> I downloaded 3.0.0-SNAPSHOT 453 and ran the test against it and I can no
> longer reproduce the issue.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]