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

ThreadCountLimit.java failed with "Native memory allocation (mprotect) failed to protect 16384 bytes for memory to guard stack pages"

XMLWordPrintable

    • b12
    • x86_64
    • linux

      The following test failed in the JDK22 CI:

      runtime/Thread/ThreadCountLimit.java

      #section:main
      ----------messages:(6/255)----------
      command: main -Xmx1g ThreadCountLimit
      reason: User specified action: run main/othervm -Xmx1g ThreadCountLimit
      started: Tue Oct 17 01:31:36 UTC 2023
      Mode: othervm [/othervm specified]
      finished: Tue Oct 17 01:33:37 UTC 2023
      elapsed time (seconds): 120.864
      ----------configuration:(0/0)----------
      ----------System.out:(344/39714)----------
      [4.903s][warning][os,thread] Attempt to protect stack guard pages failed (0x00007ef8ee54c000-0x00007ef8ee550000).
      #
      # A fatal error has been detected by the Java Runtime Environment:
      # Native memory allocation (mprotect) failed to protect 16384 bytes for memory to guard stack pages
      # An error report file with more information is saved as:
      # [4.903s][warning][os,thread] Attempt to protect stack guard pages failed (0x00007ef8ee44b000-0x00007ef8ee44f000).
      [thread 3059538 also had an error]
      [4.903s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached.
      [4.904s][warning][os,thread] Failed to start the native thread for java.lang.Thread "Thread-21723"
      /opt/mach5/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S26438/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1344c8e2-7273-448c-b254-9188e39ffa7b/runs/0511f775-e509-4a78-a7be-dc7b7cbc635d/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_runtime/scratch/0/hs_err_pid3021716.log
      [4.906s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efff6c1e000-0x00007efff6c22000).
      [4.906s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efff6416000-0x00007efff641a000).
      [4.906s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efff6a1c000-0x00007efff6a20000).

      <snip>

      [4.931s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efe30d4f000-0x00007efe30d53000).
      [4.931s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efe30143000-0x00007efe30147000).
      [4.931s][warning][os,thread] Attempt to deallocate stack guard pages failed (0x00007efe30648000-0x00007efe3064c000).
      [thread 3059534 also had an error]
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      ----------System.err:(0/0)----------
      ----------rerun:(34/5832)*----------

      result: Failed. Unexpected exit from test [exit code: 134]


      Here's the crashing thread's stack:

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

      Current thread (0x00007efb4f2ca990): JavaThread "Thread-21721" [_thread_new, id=3059537, stack(0x00007ef8ee54c000,0x00007ef8ee64c000) (1024K)]

      Stack: [0x00007ef8ee54c000,0x00007ef8ee64c000], sp=0x00007ef8ee64ab10, free space=1018k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xf32c98] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x2b8 (stackOverflow.cpp:107)
      V [libjvm.so+0xf3367d] (vmError.cpp:1589)
      V [libjvm.so+0x6955ef] (debug.cpp:225)
      V [libjvm.so+0xdba0b0] StackOverflow::remove_stack_guard_pages()+0x0 (stackOverflow.cpp:107)
      V [libjvm.so+0x905d6c] JavaThread::run()+0x1c (javaThread.cpp:671)
      V [libjvm.so+0xea79c8] Thread::call_run()+0xa8 (thread.cpp:220)
      V [libjvm.so+0xcce76a] thread_native_entry(Thread*)+0xda (os_linux.cpp:785)
      Lock stack of current Java thread (top to bottom):
      <empty>

            dholmes David Holmes
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: