[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362927#comment-16362927 ] Tilman Hausherr commented on PDFBOX-3698: - On a closed issue, it means that it was fixed for that version. The reported bug was fixed. Your different code indicates that either that or a new problem wasn't fixed in 2.0.5. It works in the trunk because some initializers were removed.I am not removing the 2.0.5 because I can't without reopening. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story >Assignee: Tilman Hausherr >Priority: Major > Fix For: 2.0.5, 3.0.0 PDFBox > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this 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-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362919#comment-16362919 ] Joseph Smith commented on PDFBOX-3698: -- Was the intention to fix this is 2.0.5? Based on the comments I was thinking that the intention is this can only be fixed in 3.0. If that is true then I think it is fine. I was just requesting that the fixed version field remove 2.0.5 so that it isn't misleading. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story >Assignee: Tilman Hausherr >Priority: Major > Fix For: 2.0.5, 3.0.0 PDFBox > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this 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-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362904#comment-16362904 ] Tilman Hausherr commented on PDFBOX-3698: - This issue is closed, I have created issue PDFBOX-4109. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story >Assignee: Tilman Hausherr >Priority: Major > Fix For: 2.0.5, 3.0.0 PDFBox > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this 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-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362866#comment-16362866 ] Joseph Smith commented on PDFBOX-3698: -- [~tilman], the initial test using Spock is written in Groovy which internally uses Class.forName to initialize the class. I have reproduced the issue starting with your Java code snippet by making the following change {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. Would you mind removing 2.0.5 from the fix version list? It tricked me into attempting that first which didn't work out. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story >Assignee: Tilman Hausherr >Priority: Major > Fix For: 2.0.5, 3.0.0 PDFBox > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this 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-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15884202#comment-15884202 ] Tilman Hausherr commented on PDFBOX-3698: - Oops! Sorry, I posted that in the wrong issue. This is meant for PDFBOX-3641. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15884187#comment-15884187 ] Andreas Lehmkühler commented on PDFBOX-3698: W.r.t to the improved files. It's interesting that this deadlock issue had an impact on the rendering as well. I would have not expect that > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15883319#comment-15883319 ] Tilman Hausherr commented on PDFBOX-3698: - Improved files: - PDFBOX-2142.pdf: XYZ "logo" image now in correct color, rest of XYZ partly different but still incorrect - PDFBOX-3549-iccv4.pdf: top right image segment now correct > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879302#comment-15879302 ] Tilman Hausherr commented on PDFBOX-3698: - [~seanstory] please test again, snapshot version should be 202 or higher. If it doesn't work, please tell what code you used as workaround. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879296#comment-15879296 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1784067 from [~tilman] in branch 'pdfbox/trunk' [ https://svn.apache.org/r1784067 ] PDFBOX-3698: initialize COSNumber/COSInteger statics in hope to avoid deadlock > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879295#comment-15879295 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1784066 from [~tilman] in branch 'pdfbox/branches/2.0' [ https://svn.apache.org/r1784066 ] PDFBOX-3698: initialize COSNumber/COSInteger statics in hope to avoid deadlock > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879274#comment-15879274 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1784064 from [~tilman] in branch 'pdfbox/branches/2.0' [ https://svn.apache.org/r1784064 ] PDFBOX-3698: revert > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879275#comment-15879275 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1784065 from [~tilman] in branch 'pdfbox/trunk' [ https://svn.apache.org/r1784065 ] PDFBOX-3698: revert > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15879247#comment-15879247 ] Andreas Lehmkühler commented on PDFBOX-3698: I'm afraid we must not remove those constant values. Yes, they are marked as deprecated for a long time, but it would be a change in the public api which can't be done in a minor release. This option has to wait until 3.0 > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15878946#comment-15878946 ] Tilman Hausherr commented on PDFBOX-3698: - [~ssteiner1] don't know but I wish I can. That call has been deprecated since 2010 in PDFBOX-637. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15878934#comment-15878934 ] Sean Story commented on PDFBOX-3698: [~tilman], With your fix, I'm no longer able to reproduce the deadlock issue. Thanks! > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15877851#comment-15877851 ] simon steiner commented on PDFBOX-3698: --- Are you allowed to remove public APIs from 2.0? > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > Fix For: 2.0.5, 2.1.0 > > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15876586#comment-15876586 ] Tilman Hausherr commented on PDFBOX-3698: - No I can't reproduce it, I tried many times. Anyway, I removed the deprecated static fields in the hope that this will help. https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.5-SNAPSHOT/ new version would be 198 or higher. If it doesn't I'll put something in PDDocument where there's another static segment related to concurrency problems. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15876579#comment-15876579 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1783922 from [~tilman] in branch 'pdfbox/branches/2.0' [ https://svn.apache.org/r1783922 ] PDFBOX-3698: remove deprecated statics in hope to avoid deadlock > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15876580#comment-15876580 ] ASF subversion and git services commented on PDFBOX-3698: - Commit 1783923 from [~tilman] in branch 'pdfbox/trunk' [ https://svn.apache.org/r1783923 ] PDFBOX-3698: remove deprecated statics in hope to avoid deadlock > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15876533#comment-15876533 ] Sean Story commented on PDFBOX-3698: [~tilman] This is a pretty decent blog that almost exactly mimics this issue: http://ternarysearch.blogspot.ru/2013/07/static-initialization-deadlock.html Have you tried re-running repeatedly? I typically find that it only takes 5-10 tries to get it to hang, but it definitely isn't guaranteed to hang every time. I can try building from source - may be a while before I get around to it though. We were able to workaround this issue by just loading both COSInteger and COSNumber in sequence in the main thread before doing any other threading. > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15876344#comment-15876344 ] Tilman Hausherr commented on PDFBOX-3698: - I don't see why this happens (apparently I'd need to do some deep reading about statics initialization) and I can't reproduce it... {code} public class PDFBox3698 { public static void main(String[] args) throws IOException, InterruptedException { Thread thread = new Thread(new Runnable() { @Override public void run() { for (int i = 0; i < 100; i++) { try { COSNumber.get("-"); } catch (IOException ex) { // } } } }); thread.start(); for (int i = 0; i < 100; i++) { COSInteger.get("-"); } thread.join(); } } {code} Can you build from source? If yes, can you remove the two deprecated fields in COSNumber and tell what happens? If no, would you be willing to test with a snapshot? > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-3698) Static Initialization Deadlock between COSNumber/COSInteger
[ https://issues.apache.org/jira/browse/PDFBOX-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15874808#comment-15874808 ] Sean Story commented on PDFBOX-3698: it also appears that at least one other person has run into this same issue: https://sourceforge.net/p/pdfbox/mailman/message/19173800/ > Static Initialization Deadlock between COSNumber/COSInteger > --- > > Key: PDFBOX-3698 > URL: https://issues.apache.org/jira/browse/PDFBOX-3698 > Project: PDFBox > Issue Type: Bug >Affects Versions: 2.0.3 > Environment: Mac OSX 10.12.3, Java(TM) SE Runtime Environment (build > 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) >Reporter: Sean Story > > h3. Problem > Using Tika 1.10 (PDF Box 1.8.10) to parse PDF documents in a multi-threaded > application, processing unexpectedly halted. Investigating the output of a > {{kill -3}}, we found: > {noformat} > "pool-2-thread-18" #50 prio=5 os_prio=0 tid=0x2af088a67000 nid=0xc9b9 in > Object.wait() [0x2af0dc803000] >java.lang.Thread.State: RUNNABLE > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 15 > "pool-2-thread-13" #45 prio=5 os_prio=0 tid=0x2af0cf910800 nid=0xc9b4 in > Object.wait() [0x2af0dc2ff000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSDocument.getObjectFromPool(COSDocument.java:720) > at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:685) > x 2 > "pool-2-thread-11" #43 prio=5 os_prio=0 tid=0x2af0cfba6000 nid=0xc9b2 in > Object.wait() [0x2af0dc0fc000] >java.lang.Thread.State: RUNNABLE > at org.apache.pdfbox.cos.COSNumber.(COSNumber.java:33) > at > org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1348) > x 1 > {noformat} > Upon further investigation, it appears that there is a risk for deadlock when > BaseParser calls {{COSNumber.get()}} and COSDocument call > {{COSInteger.get()}}. > I was able to semi-reliably replicate this issue with the below Spock test: > {noformat} > import org.apache.pdfbox.cos.COSInteger > import org.apache.pdfbox.cos.COSNumber > import spock.lang.Specification > class ThreadingIssueSpec extends Specification{ > def "testy test"(){ > setup: > Thread thread = new Thread(new Runnable(){ > @Override > void run() { > for (int i =0; i<100; i++){ > COSNumber.get("-") > } > } > }) > thread.start() > for(int i =0; i<100; i++) { > COSInteger.get("-") > } > thread.join() > expect: > 1==1 > } > } > {noformat} > (you'll likely need to run this several times before the test hangs, but it > does eventually hang) > I updated my Tika dep to 1.14 (PDF Box 2.0.3) and was still able to replicate > this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org