You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JVM crash Session causes SIGSEGV/SIGBUS under repeated use of Session.create() #8075
git clone https://github.com/dfa1/datastore.git
cd datastore
mvn test -Dtest="ReadColumnTest,VortexOhlcStoreTest" # passes (few iterations)
mvn test -Dtest="BenchmarkTest" # crashes (84+ Vortex ops)
BenchmarkTest runs 7 scales × (2 warmup + 10 measured) iterations × 3 operations (write / read /
readColumn) = 252 Session objects created in one JVM process.
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001393da064, pid=71272, tid=5635
#
# JRE version: OpenJDK Runtime Environment (27.0+1) (build 27-jep401ea3+1-1)
# Java VM: OpenJDK 64-Bit Server VM (27-jep401ea3+1-1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C [libvortex_jni9112159322116037794.dylib+0x32064] vortex_file::writer::WriteOptionsSessionExt::write_options::h986f424532314d6f+0x18
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
Possible fix:
Make Session implement AutoCloseable and expose the Cleanable so callers can release native deterministically:
changed the title [-]JVM crash Session causes SIGSEGV/SIGBUS under repeated use[/-][+]JVM crash Session causes SIGSEGV/SIGBUS under repeated use of Session.create()[/+]on May 24, 2026
NativeSession.free is also exposed as public method: I tried to use it by I got a double free (because free is also called by the cleaner).
IMHO it should be marked as package private (not part of the public API at least)
Hey @dfa1, I was able to reproduce the failure from your last example. Thanks for including a compact repro.
Interestingly, moving the Session object in the OhlcStore write method to be a static or instance-var prevents the failure.
I agree that the Session should be AutoCloseable.
Separately, I'd recommend that you update the Vortex store to hold a long-lived Session object. Creating new Sessions can be expensive, generally they should be initialized statically and shared across a process.
Thanks @a10y for feedback! I moved Session to a private static final field so it's created once and shared across all operations.
This fixes the crash I reported, but I'm now seeing a different failure when the same session is reused across multiple sequential writes + reads on different file paths:
buffer is too short for flatbuffer}
at org.apache.arrow.c.ArrowArrayStream.getNext(ArrowArrayStream.java:146)
at org.apache.arrow.c.ArrowArrayStreamReader.loadNextBatch(ArrowArrayStreamReader.java:63)
This was the reason why I started to create a new Session per call.
The first iteration (small file) succeeds. The second iteration (larger file, different URI) fails
during loadNextBatch. There is a new reproducer here:
Ahh ok, I see this now. So the issue is that the Session under the hood caches footers/metadata by the URI. It's meant for Object storage, so if you write a file, read it, then rewrite the same file path with different data and try and read again via the same session, you'll hit this issue.
Reason for this is the most common deployment environment is where you are using S3 and the files are immutable after they are written.
The immediate fix is to write to different tempfiles for your tests.
In Vortex, we should probably document this behavior in the Java docs (it's documented in the Rust API I believe), and also make it possible to disable the cache
Activity
[-]JVM crash Session causes SIGSEGV/SIGBUS under repeated use[/-][+]JVM crash Session causes SIGSEGV/SIGBUS under repeated use of Session.create()[/+]dfa1 commentedon May 24, 2026
NativeSession.freeis also exposed as public method: I tried to use it by I got a double free (because free is also called by the cleaner).IMHO it should be marked as package private (not part of the public API at least)
dfa1 commentedon May 24, 2026
hs_err_pid66301.log
Here is the full log, interesting part is:
dfa1 commentedon May 24, 2026
More minimal reproducer: this fails after 200-300 iterations on JDK 26 and about 18K on JDK 25
test: add minimal reproducer for vortex-data/vortex#8075
test: exclude diag tests from default run; disable CrashTest
a10y commentedon May 26, 2026
Hey @dfa1, I was able to reproduce the failure from your last example. Thanks for including a compact repro.
Interestingly, moving the Session object in the OhlcStore write method to be a static or instance-var prevents the failure.
I agree that the Session should be AutoCloseable.
Separately, I'd recommend that you update the Vortex store to hold a long-lived Session object. Creating new Sessions can be expensive, generally they should be initialized statically and shared across a process.
test(vortex): add repro for shared Session errno=22 on larger re-read
dfa1 commentedon May 26, 2026
Thanks @a10y for feedback! I moved
Sessionto a private static final field so it's created once and shared across all operations.This fixes the crash I reported, but I'm now seeing a different failure when the same session is reused across multiple sequential writes + reads on different file paths:
buffer is too short for flatbuffer}
at org.apache.arrow.c.ArrowArrayStream.getNext(ArrowArrayStream.java:146)
at org.apache.arrow.c.ArrowArrayStreamReader.loadNextBatch(ArrowArrayStreamReader.java:63)
This was the reason why I started to create a new Session per call.
Repro pattern (no concurrency, single thread):
The first iteration (small file) succeeds. The second iteration (larger file, different URI) fails
during loadNextBatch. There is a new reproducer here:
https://github.com/dfa1/datastore/blob/main/src/test/java/io/github/dfa1/datastore/VortexSessionReuseReproTest.java
Perhaps I'm using the API in the wrong way?
a10y commentedon May 26, 2026
Ahh ok, I see this now. So the issue is that the Session under the hood caches footers/metadata by the URI. It's meant for Object storage, so if you write a file, read it, then rewrite the same file path with different data and try and read again via the same session, you'll hit this issue.
Reason for this is the most common deployment environment is where you are using S3 and the files are immutable after they are written.
The immediate fix is to write to different tempfiles for your tests.
In Vortex, we should probably document this behavior in the Java docs (it's documented in the Rust API I believe), and also make it possible to disable the cache
dfa1 commentedon May 26, 2026
that explains everything, thank you! I'm going to adapt my code but should I keep this issue open then?
a10y commentedon May 26, 2026
Yep leave it open for now. We can use it to track the docs/config