ManifestVersionReader leaks a ZipFile Inflater per JAR (openStream never closed)
@0xadam-brown đang làm issue này rồi.
Từ ngày 16/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
ManifestVersionReader.readManifestFiles() enumerates every META-INF/MANIFEST.MF on the classpath and passes URL.openStream() into new Manifest(InputStream) without closing the stream.
java.util.jar.Manifest(InputStream) reads the stream and does not close it. For jar: URLs that stream is a ZipFileInflaterInputStream. Closing it is what calls ZipFile$CleanableResource.releaseInflater(). If it is never closed, each JAR leaves a live java.util.zip.Inflater (~64 KiB zlib window).
This still matches main and 8.41.0 / 8.52.0.
Call site
final Enumeration<URL> resources =
ClassLoader.getSystemClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
try {
final Manifest manifest = new Manifest(resources.nextElement().openStream());
// ...
} catch (Exception e) {
// ignore
}
}
Triggered from ManifestVersionDetector.checkForMixedVersions() → InitUtil.shouldInit() → Sentry.init().
Observed
Compose Desktop / packaged JVM app with ~80 JARs on the classpath (sentry-java 8.41.0):
GC.class_histogram: 168 livejava.util.zip.Inflater- async-profiler
event=java.util.zip.Inflater.<init>from process start: 79 / 174 constructors (45%) are
java.util.zip.Inflater.<init>
java.util.zip.ZipFile$CleanableResource.getInflater
java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>
java.util.zip.ZipFile.getInputStream
java.util.jar.JarFile.getBytes
java.util.jar.JarFile.checkForSpecialAttributes
java.util.jar.JarFile.isMultiRelease
java.util.jar.JarFile.getEntry
sun.net.www.protocol.jar.URLJarFile.getEntry
sun.net.www.protocol.jar.JarURLConnection.connect
sun.net.www.protocol.jar.JarURLConnection.getInputStream
java.net.URL.openStream
io.sentry.internal.ManifestVersionReader.readManifestFiles
io.sentry.ManifestVersionDetector.checkForMixedVersions
io.sentry.util.InitUtil.shouldInit
io.sentry.Sentry.init
Suggested fix
try (InputStream is = resources.nextElement().openStream()) {
final Manifest manifest = new Manifest(is);
// existing attribute handling
} catch (Exception e) {
// ignore
}
Manifest does not take ownership of the stream, so try-with-resources is required even on the success path.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 478
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 71
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Improvement Java Platform: Android Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
getsentry/sentry-java#6145 · 1 bình luận · 1 người được giao ·
-
Bug Java Platform: Android Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
Feature Java Platform: Java Spans
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5984 · 1 bình luận ·
-
Android Task Traces
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5376 · 1 bình luận ·
-
Android Docs Errors
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
getsentry/sentry-java#5375 · 1 bình luận ·
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
[Bug] 统计页面无法重置token和汇率 Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
AAswordman/Operit#1265 · 3 bình luận ·
-
Tambahkan bahasa Indonesia Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
acristescu/OnlineGo#216 ·
-
Remove custom segment colors Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
libre-tube/LibreTube#8803 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
status: waiting-for-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
spring-projects/spring-security#19781 ·