Bethan Palmer FollowBethan is a Java developer and product manager at IDRsolutions. She has spoken at conferences including JavaOne/Code One, DevFest and NetBeans days and is a Java Champion. She has a degree in English Literature.

Interesting PDF bugs – Nasty Java JVM bug (revisited)

December 6, 2016 1 min read

Here at IDRSolutions, one of the features of our JPedal library is a PDF to image converter. Occasionally we get bug reports from our customers, and if there is an issue in our code we can generally fix it very quickly. However, sometimes we see issues which are specific to the JVM and these can be complex to fix.

Four years and two releases of Java later, we are still seeing a related error. A customer recently sent in another file which caused Java to crash when using our library. After spending some time debugging the code to find exactly where the crash was happening, we found that the problem was again related to the Stroke class. As with the previous case, it was an issue with drawing a dotted line.

This time, the crash happened when:

the dash phase was equal to 0,

the dash array was not null and

the shape had an end curve.

This kind of error is particularly nasty because it can be very hard to debug. We now have a workaround for this which stops the crash. It is also worrying that something as simple as setting a value can cause the JVM to crash.

Have you ever come across this error? What was your solution?

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the Blog RSS.

Bethan Palmer FollowBethan is a Java developer and product manager at IDRsolutions. She has spoken at conferences including JavaOne/Code One, DevFest and NetBeans days and is a Java Champion. She has a degree in English Literature.