Skip to content

JVM wheel on Windows, Python 3.13: one HotSpot access violation in a jvector C2 frame in the examples run, crash report lost #352

Open

Description

@tae898

The JVM wheel crashed once in a Windows examples run in CI, inside HotSpot. The rerun of the same job passed, I have not reproduced it, and I could not read the crash report. I file it so that a second occurrence has something to compare with. It is not the native-image parity crash of #295: this is the JVM wheel (arcadedb-jvm, HotSpot), not the native wheel.

What the CI log shows (Test Python Examples run 42789429856, workflow_dispatch on 1454809, attempt 1, job Test Python Examples (windows/amd64, Python 3.13)):

  • The example 13_stackoverflow_hybrid_queries.py exited with code 1. The other examples of that job passed.
  • The JVM printed EXCEPTION_ACCESS_VIOLATION (0xc0000005) and the problematic frame J 8848 c2 io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider.isDiverse(...), a C2-compiled method.
  • JVM: Corretto-25.0.5.0.10 (25.0.5+10-LTS), windows-amd64, g1 gc, compact obj headers.
  • The JVM wrote hs_err_pid4416.log to C:/Users/runneradmin/AppData/Local/arcadedb/log/ and a minidump hs_err_pid4416.mdmp to the examples directory on the runner. Neither was uploaded, so both are gone with the runner.
  • Attempt 2 of the same job passed.

I do not claim a jvector bug. One crash in JIT-compiled code can come from the JVM, the runner or the library, and the report that would tell is lost.

What I do next:

  1. Make the Windows examples job upload hs_err_pid*.log and hs_err_pid*.mdmp when it fails, so that the next occurrence leaves the file. I will open that as a small CI pull request.
  2. Append every further occurrence here with its run, job and frame.
  3. If it recurs with the same frame, I try a repro in Java on the engine API and file it with the jvector maintainers.

The release 26.11.1.post2 was not held for this: the rerun passed, and the two release runs of the tag, on the same commit, passed.

Activity

  1. added
    bug
    github_actions
    jvm
    on Nov 10, 2026
  2. added
    documentation
    python
    vector
    on Nov 10, 2026
  3. added this to the 26.12.1 milestone on Nov 10, 2026
  4. modified the milestones: 26.12.1, 27.1.1 on Nov 22, 2026
  5. tae898 commented on Nov 22, 2026

    @tae898
    CollaboratorAuthor

    A second occurrence with the same frame. I logged it on #295 at the time (comment of 2026-11-12), and it belongs here. In the Windows examples job of the pull request run for #374 (run 43137532222, Python 3.14), 11_vector_index_build.py died with EXCEPTION_ACCESS_VIOLATION (0xc0000005) in the C2-compiled io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider.isDiverse, on Corretto 25.0.5+10, windows-amd64. The rerun of the failed job passed.

    This time the crash report was kept, because #364 uploads it. The hs_err log is in the artifact jvm-crash-logdir-windows-amd64-py3.14 and the minidump is in jvm-crash-cwd-windows-amd64-py3.14. Both are run artifacts and expire on 2026-11-26, so they have to be downloaded before then.

    That makes two occurrences with the same frame, which is the condition of step 3 above: a repro in Java on the engine API, and then a report to the jvector maintainers with the hs_err log.

    I also moved this issue to milestone 27.1.1, because nothing ships for it in 26.12.1.

  6. tae898 commented on Nov 23, 2026

    @tae898
    CollaboratorAuthor

    A third occurrence, and this time I compared the two crash reports that were kept. The push run on main at 0d5ed27 (run 45119638025, Windows, Python 3.11, JVM wheel) failed 11_vector_index_build.py with EXCEPTION_ACCESS_VIOLATION in the C2-compiled io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider.isDiverse (87 bytes). The next example passed, so the job was red for one crash and nothing else. The red-main report for it is #464, which I am closing with a link here.

    I read the hs_err logs of this run (artifact jvm-crash-logdir-windows-amd64-py3.11) and of the run of 2026-11-12 (jvm-crash-logdir-windows-amd64-py3.14), which I downloaded before it expires. What they have in common:

    run 43137532222 run 45119638025
    JVM Corretto 25.0.5.0.10 Corretto 25.0.5.1.2
    host Windows Server 2025, AMD EPYC 9V74, 4 cores the same
    thread ForkJoinPool-1-worker-2 ForkJoinPool-1-worker-3
    time after JVM start 4.08 s 3.94 s
    fault read of address 0x10 read of address 0x10
    RAX 0 0
    RBX, RDX, RBP, RDI, R9 0x150, 0x4c87, 0xfa00, 0x180, 0x180 the same five values

    So it is one fault, not two: the same compiled method, the same null base register, the same loop state. The code at the faulting pc is EVEX-encoded, which means AVX-512 instructions, and the host has AVX-512. The command lines of both JVMs carry --add-modules=jdk.incubator.vector and -XX:+UseCompactObjectHeaders; the second is set by start_jvm (src/arcadedb/jvm.py), the CDS archive of #332 depends on it. I have not seen this crash on Linux or macOS, and I have no rate: three crashes in the Windows examples job in 13 days (2026-11-10 in 13_stackoverflow_hybrid_queries.py, 2026-11-12 and 2026-11-23 in 11_vector_index_build.py), out of every Windows run in that time, which I did not count.

    I searched the jvector issues and the OpenJDK bug tracker through a web search and found no report of this crash. What I do not know is whether the cause is C2 with the Vector API on this CPU, compact object headers, or jvector's loop; none of the three is shown by two crash reports.

    What I will do in 27.1.1 (this issue stays on that milestone): a Windows job that runs the vector build of that example in a loop, with and without -XX:+UseCompactObjectHeaders, to see which arm crashes and at what rate, and then report to jvector and Corretto with the two logs. The minidump of run 45119638025 (artifact jvm-crash-cwd-windows-amd64-py3.11, 311 MB) expires on 2026-12-07 and the one of the earlier run on 2026-11-26; I did not download them because the logs carry the registers and the nmethod, and a dump is only needed if a maintainer asks.

    (Edited 2026-11-23: the first version said one occurrence per about ten days, which I had not counted; it now says what I know.)

  7. tae898 commented on Nov 23, 2026

    @tae898
    CollaboratorAuthor

    I edited my comment above: its first version gave a rate of one crash per about ten days, which I had not counted. It now lists the three crashes (2026-11-10, 2026-11-12, 2026-11-23) and says there is no rate.

  8. tae898 commented on Nov 24, 2026

    @tae898
    CollaboratorAuthor

    A fourth occurrence, on the push run of main at edf6786 (run 45479829213, Windows, Python 3.12, JVM wheel, Corretto 25.0.5.1): 11_vector_index_build.py (arcadedb_sql backend, minimal) failed with EXCEPTION_ACCESS_VIOLATION (0xc0000005) in the C2-compiled io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider.isDiverse, the same frame as the third one. The other examples of that job passed. The crash report file stayed on the runner again, so there is nothing new to compare. The failing lines of the job log are the whole evidence.

    The crashes so far are 2026-11-10, 2026-11-12, 2026-11-23 and 2026-11-24, all on Windows. I still give no rate.

    Edited 2026-11-25: I removed two statements that I had not checked (that the same example passed on the pull-request runs of the five merged changes, and the list of Python versions for the earlier crashes). A pull request runs only the fast tier, so those runs do not show it.

  9. tae898 commented on Nov 24, 2026

    @tae898
    CollaboratorAuthor

    I corrected my comment above: it said that the same example passed on the pull-request runs of the five merged changes and listed Python versions for the earlier crashes, and I had checked neither. Both statements are gone; the run, the crash frame and the dates stay as they were. I made the same kind of correction in #484.

  10. tae898 commented on Nov 29, 2026

    @tae898
    CollaboratorAuthor

    A fifth occurrence, and this time the crash report was kept: run 46222977851, a scheduled run of main at d5c2bc3, Windows, Python 3.11, example 03_vector_search.py. The report is the artifact jvm-crash-logdir-windows-amd64-py3.11 of that run (kept for a limited time).

    The lines that matter:

    JRE version: OpenJDK Runtime Environment Corretto-25.0.5.1.2 (25.0.5.1+2) (build 25.0.5.1+2-LTS)
    J 4463 c2 io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider.isDiverse
    siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000010
    Compiled method (c2) 7456 4463       4       io.github.jbellis.jvector.graph.diversity.VamanaDiversityProvider::isDiverse (87 bytes)
    Current thread (0x000001b317034a30):  JavaThread "ForkJoinPool-1-worker-3" daemon [_thread_in_Java, id=6832, stack(0x0000009a14ba0000,0x0000009a14d90000) (1984K)]
    Host: INTEL(R) XEON(R) PLATINUM 8573C, 4 cores, 15G,  Windows Server 2025 , 64 bit Build 26100 (10.0.26100.33822)
    Time: Sun Nov 29 04:32:10 2026 Coordinated Universal Time elapsed time: 7.315825 seconds (0d 0h 0m 7s)
    UseCompactObjectHeaders                  = true                           {product lp64_product} {command line}
    

    It is a read of address 0x10 in the C2 code of isDiverse, on a fork join pool worker a few seconds after start, with compact object headers on. I draw no cause from one report.

  11. tae898 commented on Nov 29, 2026

    @tae898
    CollaboratorAuthor

    Likely cause: Windows loses AVX register state when a thread resumes after a safepoint pause, below the JVM (JDK-8365196). If so, affected machines can also return wrong similarity scores with no error, not only crash. I have not reproduced it myself yet.

    I read the five crash reports I could get (today's and four older ones):

    Crash CPU Windows build Reference held in Squared norm computed Sum of squares of the first 256 of 384 floats
    11-12 AMD EPYC 9V74 26100.33648 xmm20 0.374 0.649
    11-22 AMD EPYC 9V74 26100.33822 xmm21 0.955 0.647
    11-23 AMD EPYC 9V74 26100.33822 xmm20 0.291 0.626
    11-24 AMD EPYC 9V45 26100.33822 xmm20 0.366 0.613
    11-29 Xeon 8573C 26100.33822 xmm21 0.324 0.688

    In all five, the faulting load reads through a reference that C2 parked in an AVX-512 register, which reads back as zero within about a millisecond after a safepoint pause. In 4 of them, the squared norm the last cosine computed is smaller than the sum of squares of its first 256 floats alone, which is only possible if parts of the vector registers were lost. isDiverse itself is a short plain loop and its compiled code matches it, so jvector looks like the place where the damage shows, not the cause. Compact object headers show no sign of being involved.

    The main source for the Windows bug is this reproducer, a new repository: by its account, every Windows Server 2025 kernel it examined (26100.32230 to 26100.33828) is affected while a kernel feature switch is off, no fixed Server kernel exists yet, and Windows 11 is fixed from 26100.7920. All five runners were Server builds in that range. The OpenJDK bug page did not load for me, and I found no statement from Microsoft.

    Something to try on an affected Windows machine, not yet tested against this crash: ARCADEDB_JVM_ARGS="-XX:UseAVX=2 -XX:MaxVectorSize=16".

    Also a correction: the JVM wheel has crashed this way 8 times in 383 Windows example job executions since 2026-11-10 (5 were listed above), including runs 43362821925, 43557217912 (attempt 2), and 45034344686.

    Next: a CI loop on windows-2025 with and without the flags.

  12. tae898 commented on Nov 29, 2026

    @tae898
    CollaboratorAuthor

    With ARCADEDB_JVM_ARGS="-XX:UseAVX=2 -XX:MaxVectorSize=16" I got 0 crashes in 600 runs of 11_vector_index_build.py, and without the flags 6 in 600. The flags made the index build 37% to 41% slower. I think they should ship, only for Windows hosts with AVX-512. The two arms ran on different CPUs, so this supports the flags and does not prove them.

    Each run was a fresh process and JVM on a windows-2025 runner, with the JVM wheel and the example arguments of the examples job.

    A: no extra flags B: -XX:UseAVX=2 -XX:MaxVectorSize=16
    Runs 600 600
    Crashes 6 0
    Crashes with the isDiverse frame 6 0
    Failures without a crash report 0 0
    CPU (one job, one host) Intel Xeon 8573C AMD EPYC 9V74
    Windows build 26100.33828 26100.33828

    Cost of the flags, medians of 15 runs per arm, A and B taken in turn on the same host:

    Host Measured A (s) B (s) B against A
    Intel Xeon 8573C create_index phase 6.90 9.75 +41%
    Intel Xeon 8573C whole example, process start to exit 11.77 14.65 +24%
    AMD EPYC 9V74 create_index phase 5.59 7.66 +37%
    AMD EPYC 9V74 whole example, process start to exit 9.76 11.86 +21%

    What is shown:

    • The crash can be provoked in CI with this one example: 6 of 600 runs (1.0%), all in VamanaDiversityProvider.isDiverse, 4.3 to 5.1 s after JVM start.
    • It is the same pattern as in the five earlier reports: in all 6 new reports the instruction before the faulting load moves the reference out of xmm20 or xmm21, within about 1 ms after a G1 pause ended. The load reads an address just above zero (0x10 x3, 0x14 x1, 0x1c x1, 0x68 x1).
    • The flags were in force: UseAVX went from 3 to 2 and MaxVectorSize from 64 to 16 (-XX:+PrintFlagsFinal on both hosts).
    • No run with the flags failed. On that host alone, 600 clean runs put the crash rate with the flags below 0.5% per run (95%).

    What is not shown:

    • That AMD EPYC 9V74 would have crashed without the flags. Earlier crash reports come from this CPU model, but in this test it ran only 16 runs without them (0 crashes). If both hosts had the same crash rate, 6 against 0 would have a two-sided Fisher p of 0.031.
    • That results are correct with or without the flags. I only watched for crashes.
    • That the Windows AVX state bug is the cause. The result fits it and does not test it.
    • Whether -XX:UseAVX=2 alone is enough (it might cost less), and what the flags cost on other workloads.

    Why I would ship it anyway: the failure is a dead process, and if the likely cause is right it can also be a wrong similarity score with no error. In the five reports I read, the lost reference sat in xmm20 or xmm21, and as far as I know HotSpot does not use those registers at UseAVX=2 (I did not measure that here). The shape I propose: add the flags only on Windows when IsProcessorFeaturePresent(41) (AVX-512) is true, let a user's own -XX:UseAVX or -XX:MaxVectorSize win, document the cost, and remove it once a fixed Windows build is confirmed. That check returned true on both hosts above, where the JVM chose UseAVX=3, and false on an AMD EPYC 7763 in a trial run. I have not changed the library.

    Method and the rest of the numbers
    • Runs: arm A, arm B. Their artifacts hold one row per run and the crash reports, for 30 days. Minidumps were not uploaded.
    • Branch win352-avx-flag-loop, a test branch that is not meant to be merged. There the file of the examples workflow is replaced by the loop, so that it can be started by hand.
    • Wheel: arcadedb-jvm 26.12.1.dev0 from the examples-wheel-windows-amd64 artifact of run 46222977851 (the run with the 11-29 crash), SHA-256 431449761fe02fd4d2d77124b800a8b1b49d54611a19a85d871ceb822ee95d38. Java 25.0.5.1+2-LTS, Python 3.12, runner image 20261123.321.1, 4 logical CPUs.
    • Example arguments, read from scripts/run_examples.sh: --backend arcadedb_sql --dataset stackoverflow-tiny --threads 1 --mem-limit 2g --batch-size 500 --beam-width 100 --quantization NONE --run-label ci11_arcadedb_sql.
    • Each job first ran one warm-up run and 15 timed runs of each arm, then up to 600 runs of its own arm. Both jobs reached 600.
    • Counting every run of both jobs: A 6 crashes in 632, B 0 in 632.
    • A first trial landed on an AMD EPYC 7763 and ran nothing. A second one, on an Intel Xeon 8573C, ran 6 runs per arm to measure the time of a run, with no crash.

    Range of the timed runs, in seconds:

    Host Measured A B
    Intel Xeon 8573C create_index phase 6.64 to 7.53 9.50 to 9.95
    Intel Xeon 8573C whole example, process start to exit 11.50 to 12.94 14.25 to 15.20
    AMD EPYC 9V74 create_index phase 5.36 to 5.74 7.17 to 7.92
    AMD EPYC 9V74 whole example, process start to exit 9.46 to 10.11 11.60 to 12.40
  13. tae898 commented on Nov 29, 2026

    @tae898
    CollaboratorAuthor

    I merged the workaround in #531, so the JVM wheel now adds -XX:UseAVX=2 -XX:MaxVectorSize=16 on Windows hosts with AVX-512. Before merging I ran both settings in turn on one such host, which closes the main gap in my last comment: that CPU model does crash without the flags.

    AMD EPYC 9V74, one windows-2025 job Without the flags With the flags
    Runs 338 338
    Crashes (VamanaDiversityProvider.isDiverse) 2 0
    create_index, median (s) 5.96 7.98 (34% longer)
    Whole example, median (s) 10.55 12.52 (19% longer)

    2 against 0 on its own is too few to rule out chance, and the Windows AVX-512 state bug is still only the likely cause. I'm keeping this issue open until a fixed Windows build lets me remove the flags. ARCADEDB_WINDOWS_AVX512_WORKAROUND=0 turns them off. Run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdocumentationgithub_actionsjvmpythonvector

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions