{"record":{"id":"1785ab1894323ee0","repo":"oracle/graal","slug":"unsupported-barrier-sequence-s","errorCode":null,"errorMessage":"unsupported barrier sequence %s","messagePattern":"unsupported barrier sequence (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java","lineNumber":627,"sourceCode":"    public final long shenandoahWriteBarrierPre = getAddress(\"ShenandoahRuntime::write_barrier_pre\", -1L, hasShenandoahGC);\n\n    // aarch64 specific nmethod entry barrier support\n    // @formatter:off\n    public final int BarrierSetAssembler_nmethod_patching_type = getFieldValue(\"CompilerToVM::Data::BarrierSetAssembler_nmethod_patching_type\", Integer.class, \"int\", -1, osArch.equals(\"aarch64\"));\n    public final long BarrierSetAssembler_patching_epoch_addr = getFieldValue(\"CompilerToVM::Data::BarrierSetAssembler_patching_epoch_addr\", Long.class, \"address\", -1L,\n                    osArch.equals(\"aarch64\"));\n    public final int NMethodPatchingType_stw_instruction_and_data_patch = getConstant(\"NMethodPatchingType::stw_instruction_and_data_patch\", Integer.class, -1, osArch.equals(\"aarch64\"));\n    public final int NMethodPatchingType_conc_instruction_and_data_patch = getConstant(\"NMethodPatchingType::conc_instruction_and_data_patch\", Integer.class, -1, osArch.equals(\"aarch64\"));\n    // conc_data_patch is currently only exposed by Oracle JDK builds.\n    public final int NMethodPatchingType_conc_data_patch = getConstant(\"NMethodPatchingType::conc_data_patch\", Integer.class, -1, osArch.equals(\"aarch64\") && isOracleVmVendor);\n    // @formatter:on\n\n    {\n        if (osArch.equals(\"aarch64\")) {\n            if (BarrierSetAssembler_nmethod_patching_type != NMethodPatchingType_stw_instruction_and_data_patch &&\n                            BarrierSetAssembler_nmethod_patching_type != NMethodPatchingType_conc_instruction_and_data_patch &&\n                            (!isOracleVmVendor || BarrierSetAssembler_nmethod_patching_type != NMethodPatchingType_conc_data_patch)) {\n                throw new IllegalArgumentException(\"unsupported barrier sequence \" + BarrierSetAssembler_nmethod_patching_type);\n            }\n        }\n    }\n\n    // Tracking of the number of monitors held by the current thread. This is used by loom but in\n    // JDK 20 was enabled by default to ensure it was correctly implemented.\n    public final int threadHeldMonitorCountOffset = getFieldOffset(\"JavaThread::_held_monitor_count\", Integer.class, \"intx\");\n    public final int threadLockStackOffset = getFieldOffset(\"JavaThread::_lock_stack\", Integer.class, \"LockStack\");\n    public final int lockStackTopOffset = getFieldOffset(\"LockStack::_top\", Integer.class, \"uint32_t\");\n    public final int lockStackEndOffset = getConstant(\"LockStack::_end_offset\", Integer.class);\n    public final int threadOmCacheOffset = getFieldOffset(\"JavaThread::_om_cache\", Integer.class, \"OMCache\");\n    public final int threadUnlockedInflatedMonitorOffset = getFieldOffset(\"JavaThread::_unlocked_inflated_monitor\", Integer.class, \"ObjectMonitor*\");\n    public final int omCacheOopToOopDifference = getConstant(\"OMCache::oop_to_oop_difference\", Integer.class);\n    public final int omCacheOopToMonitorDifference = getConstant(\"OMCache::oop_to_monitor_difference\", Integer.class);\n\n    public final long throwAndPostJvmtiExceptionAddress = getAddress(\"JVMCIRuntime::throw_and_post_jvmti_exception\");\n    public final long throwKlassExternalNameExceptionAddress = getAddress(\"JVMCIRuntime::throw_klass_external_name_exception\");\n    public final long throwClassCastExceptionAddress = getAddress(\"JVMCIRuntime::throw_class_cast_exception\");","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java#L609-L645","documentation":"On aarch64, GraalHotSpotVMConfig's initializer validates BarrierSetAssembler_nmethod_patching_type against the known NMethodPatchingType constants (stw_instruction_and_data_patch, conc_instruction_and_data_patch, and Oracle-build-only conc_data_patch). An unrecognized value throws IllegalArgumentException('unsupported barrier sequence N') because Graal cannot emit correct nmethod patching for unknown barrier-set sequences.","triggerScenarios":"Running Graal on an aarch64 HotSpot build whose BarrierSetAssembler::_nmethod_patching_type has a value Graal does not enumerate — e.g. a newer/patched/experimental collector barrier set, or a non-Oracle build exposing a type only expected on Oracle JDKs; the check runs in the config instance initializer at first Graal use.","commonSituations":"New or backported HotSpot aarch64 builds adding a patching type before Graal catches up; custom VM builds; running a Graal version older than the JDK it is embedded in on aarch64.","solutions":["Use a Graal/JVMCI (or JDK with embedded libgraal) version at least as new as the HotSpot sources it runs on, so the patching-type constants match","If you build HotSpot yourself, set the barrier set's _nmethod_patching_type to one of the supported constants","As a stopgap, disable JVMCI/Graal on that VM until versions are aligned"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep JDK and Graal versions lockstep on aarch64","Rebuild Graal from the same HotSpot sources when patching GC barrier sets","Watch Graal release notes for NMethodPatchingType changes"],"tags":["graal-compiler","aarch64","vm-config","compatibility"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}