Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8354328

[leyden] nmethod::purge() crashes with invalid malloc pointer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • repo-leyden
    • repo-leyden
    • hotspot

      I saw this crash once in my personal testing

      runtime/cds/appcds/applications/QuarkusGettingStarted.java#aot

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/d2398cde-9325-49c3-b030-8961a4f0a253-S45471/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/541e59cf-9323-4e29-8966-e79b69e740f9/runs/a00e353d-055c-46e3-9b55-06f52c01e0b1/workspace/open/src/hotspot/share/nmt/mallocHeader.inline.hpp:102), pid=75066, tid=18691
      # fatal error: Not a valid malloc pointer: 0x000000011e2e2996: block address is unaligned
      #
      # JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-internal-LTS-2025-04-10-0301192.ioi.lam.le5)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-internal-LTS-2025-04-10-0301192.ioi.lam.le5, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
      # Core dump will be written. Default location: core.75066
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      --------------- S U M M A R Y ------------

      Command Line: -XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/23/37/bundles/macos-aarch64/jdk-23_macos-aarch64_bin.tar.gz/jdk-23.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/e06a84a2-297b-45cc-807a-21ee0dbfa509-S611/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/3387bb93-5526-4cb0-bd8e-c03e3d7b2f71/runs/a359e086-1f5e-4002-afdf-e204de0cbd45/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_cds/tmp -DautoQuit=true -Dquarkus.http.port=0 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies -XX:+UnlockDiagnosticVMOptions -XX:VerifyArchivedFields=2 -Xlog:cds:file=QuarkusGettingStarted.production.log::filesize=0 -XX:AOTMode=on -XX:AOTCache=QuarkusGettingStarted.aot -Xlog:scc=error Main

      Host: jpg-mac-arm-704.oraclecorp.com, "Macmini9,1" arm64, 8 cores, 16G, Darwin 21.4.0, macOS 12.3.1 (21E258)
      Time: Thu Apr 10 03:38:42 2025 GMT elapsed time: 4.056103 seconds (0d 0h 0m 4s)

      --------------- T H R E A D ---------------

      Current thread (0x0000000156872e10): VMThread "VM Thread" [id=18691, stack(0x0000000170894000,0x0000000170a97000) (2060K)]

      Stack: [0x0000000170894000,0x0000000170a97000], sp=0x0000000170a95dd0, free space=2055k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x126d1f0] VMError::report(outputStream*, bool)+0x1b00 (mallocHeader.inline.hpp:102)
      V [libjvm.dylib+0x1270974] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x56c
      V [libjvm.dylib+0x5cabe8] DebuggingContext::~DebuggingContext()+0x0
      V [libjvm.dylib+0xde594c] MallocHeader* MallocHeader::resolve_checked_impl<void*, MallocHeader*>(void*)+0x108
      V [libjvm.dylib+0xde4ee8] MallocTracker::record_free_block(void*)+0x44
      V [libjvm.dylib+0xf182a4] os::free(void*)+0x12c
      V [libjvm.dylib+0xeb885c] nmethod::purge(bool)+0x224
      V [libjvm.dylib+0x4cf1d4] ClassUnloadingContext::purge_nmethods()+0xac
      V [libjvm.dylib+0x717e48] G1CollectedHeap::unload_classes_and_code(char const*, BoolObjectClosure*, GCTimer*)+0x438
      V [libjvm.dylib+0x72ca84] G1ConcurrentMark::remark()+0x2c0
      V [libjvm.dylib+0x7f3bf8] VM_G1PauseConcurrent::doit()+0x1bc
      V [libjvm.dylib+0x12782fc] VM_Operation::evaluate()+0x11c
      V [libjvm.dylib+0x1295894] VMThread::evaluate_operation(VM_Operation*)+0x114
      V [libjvm.dylib+0x1296304] VMThread::inner_execute(VM_Operation*)+0x320
      V [libjvm.dylib+0x1295424] VMThread::loop()+0x98
      V [libjvm.dylib+0x1295134] VMThread::run()+0x15c
      V [libjvm.dylib+0x11ae9f8] Thread::call_run()+0xf4
      V [libjvm.dylib+0xf1f9a8] thread_native_entry(Thread*)+0x1d4
      C [libsystem_pthread.dylib+0x726c] _pthread_start+0x94
      VM_Operation (0x000000017005abe0): G1PauseRemark, mode: safepoint, requested by thread 0x0000000156829010

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: