[jira] [Commented] (PDFBOX-4109) Static Initialization Deadlock between COSNumber/COSInteger (2)

2018-02-27 Thread Joseph Smith (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16378682#comment-16378682
 ] 

Joseph Smith commented on PDFBOX-4109:
--

Sounds fine to me.  When I get an opportunity I will try to test it against our 
real use case instead of this test.  Let you know if there are any issues but 
we use Tika which uses PDDocument so it sounds like there shouldn't be an 
issues.  Thanks.

> 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: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4109) Static Initialization Deadlock between COSNumber/COSInteger (2)

2018-02-26 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16377593#comment-16377593
 ] 

Tilman Hausherr commented on PDFBOX-4109:
-

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: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4109) Static Initialization Deadlock between COSNumber/COSInteger (2)

2018-02-26 Thread Joseph Smith (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16377545#comment-16377545
 ] 

Joseph Smith commented on PDFBOX-4109:
--

A bit of both I suppose.  I was reviewing the code that produced the original 
issue which is in a production deployment.  I was exploring the benefit of 
updating versions in order to remove our work around for this issue and clean 
up the code a bit. 

Based on the original developers research the issue came down to this test 
which is in our code base.  I noticed that the issue could not be reproduced 
easily last time because the original test was written in Groovy.  I created a 
Java version which would reproduce the test just to help illustrate and 
reproduce the original issue.

Did something change about the initialization of PDDocument between 1.8.10 and 
2.0.8 that would have impact?

> 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: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4109) Static Initialization Deadlock between COSNumber/COSInteger (2)

2018-02-24 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16375752#comment-16375752
 ] 

Tilman Hausherr commented on PDFBOX-4109:
-

[~jesmith3] does the deadlock happen in your production code, or were you just 
trying to find some easy way to reproduce a closed issue? I looked at the test 
code and from what I see, it can only work if {{PDDocument}} isn't initialized 
first. Which would be unusual IMHO.

> 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: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org