question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.io.IOException: Buffer underflow

See original GitHub issue

Hello,

I ran into an issue while using ClassGraph version 4.8.65 with Java 8. ClassGraph is able to find most classes on my classpath, but there is one top-level class in particular for which it always throws a java.io.IOException: Buffer underflow error in the verbose output. I cloned down the classgraph repo, and updated the error handling to print the full stacktrace and got this:

java.io.IOException: Buffer underflow
at nonapi.io.github.classgraph.fileslice.reader.ClassfileReader.readTo(ClassfileReader.java:209)
at nonapi.io.github.classgraph.fileslice.reader.ClassfileReader.skip(ClassfileReader.java:395)
at io.github.classgraph.Classfile.readMethods(Classfile.java:1463)
at io.github.classgraph.Classfile.<init>(Classfile.java:1663)
at io.github.classgraph.Scanner$ClassfileScannerWorkUnitProcessor.processWorkUnit(Scanner.java:664)
at io.github.classgraph.Scanner$ClassfileScannerWorkUnitProcessor.processWorkUnit(Scanner.java:587)
at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246)
at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkQueue(WorkQueue.java:161)
at io.github.classgraph.Scanner.processWorkUnits(Scanner.java:342)
at io.github.classgraph.Scanner.performScan(Scanner.java:902)
at io.github.classgraph.Scanner.openClasspathElementsThenScan(Scanner.java:1044)
at io.github.classgraph.Scanner.call(Scanner.java:1079)
at io.github.classgraph.Scanner.call(Scanner.java:78)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

I can’t post the source code due to IP issues. So I tried to create a test class that resembled my issue as closely as possible, but was unable to reproduce the issue with that class.

I did, however, find 2 publicly available classes which produce the issue:

  • org.apache.datasketches.cpc.CompressionData from org.apache.datasketches:datasketches-java-1.1.0-incubating
  • com.google.thirdparty.publicsuffix.PublicSuffixPatterns from com.google.guava:guava:25.0-jre

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukehutchcommented, Mar 30, 2020

Released in 4.8.66. Thanks again!

0reactions
lukehutchcommented, Mar 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Buffer Underflow Exception java - Stack Overflow
The problem is you are mapping in a small region, e.g. 4 KB and then attempting to read the whole file which I...
Read more >
BufferUnderflowException (Java Platform SE 7 )
public class BufferUnderflowException extends RuntimeException. Unchecked exception thrown when a relative get operation reaches the source buffer's limit.
Read more >
[#HIVE-12779] Buffer underflow when inserting data to table
I face a buffer underflow problem when inserting data to table from hive ... getMapWork(Utilities.java:296) at org.apache.hadoop.hive.ql.io.
Read more >
KryoException: Buffer underflow - Google Groups
at java.lang.Thread.run(Thread.java:744) Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow. at com.esotericsoftware.kryo.io.
Read more >
How to fix buffer underflow error for MP servers
ERROR: General , 1647354472404> 9,048,211> GameServer.main> Exception thrown java.io.IOException: Error loading GlobalModData. at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found