Description of problem: Periodically, I get an internal error when I am running a custom java program. Version-Release number of selected component (if applicable): java-1.6.0-openjdk-1.6.0.0-22.b16.fc11.x86_64 How reproducible: Maybe 30% of the time the program crashes. I have not yet been able to reproduce this with a smaller version of the program. It did not occur at all with the java in Fedora 10. Additional info: The following message log was created. # A fatal error has been detected by the Java Runtime Environment: # # java.lang.OutOfMemoryError: pthread_getattr_np # # Internal Error (os_linux_x86.cpp:681), pid=10579, tid=140408432793872 # Error: pthread_getattr_np # # JRE version: 6.0-b16 # Java VM: OpenJDK 64-Bit Server VM (14.0-b15 mixed mode linux-amd64 ) # Distribution: Custom build (Fri May 29 14:28:18 EDT 2009) # If you would like to submit a bug report, please include
I captured a strace from the previously filed error: # # A fatal error has been detected by the Java Runtime Environment: # # java.lang.OutOfMemoryError: pthread_getattr_np # # Internal Error (os_linux_x86.cpp:681), pid=6288, tid=139871620405520upeek: ptrace(PTRACE_PEEKUSER,6319,80,0): No such process Partial strace: 6317 mmap(0x7f3600000000, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6309 clone( <unfinished ...> 6317 <... mmap resumed> ) = 0x7f3600000000 6309 <... clone resumed> child_stack=0x7f36664fa210, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f36664fa9e0, tls=0x7f36664fa910, child_tidptr=0x7f36664fa9e0) = 6318 6318 set_robust_list(0x7f36664fa9f0, 0x18 <unfinished ...> 6317 mprotect(0x7f3600000000, 135168, PROT_READ|PROT_WRITE <unfinished ...> 6318 <... set_robust_list resumed> ) = 0 6317 <... mprotect resumed> ) = 0 6318 gettid( <unfinished ...> 6317 sched_getaffinity(6317, 32, <unfinished ...> 6318 <... gettid resumed> ) = 6318 6317 <... sched_getaffinity resumed> { f }) = 8 6318 rt_sigprocmask(SIG_BLOCK, NULL, <unfinished ...> 6317 sched_getaffinity(6317, 32, <unfinished ...> 6318 <... rt_sigprocmask resumed> [QUIT], 8) = 0 6317 <... sched_getaffinity resumed> { f }) = 8 6318 rt_sigprocmask(SIG_UNBLOCK, [HUP INT ILL BUS FPE SEGV USR2 TERM], <unfinished ...> 6317 mmap(0x7f36664fb000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0 <unfinished ...> 6318 <... rt_sigprocmask resumed> NULL, 8) = 0 6317 <... mmap resumed> ) = 0x7f36664fb000 6318 rt_sigprocmask(SIG_BLOCK, [QUIT], <unfinished ...> 6317 mprotect(0x7f36664fb000, 12288, PROT_NONE <unfinished ...> 6318 <... rt_sigprocmask resumed> NULL, 8) = 0 6317 <... mprotect resumed> ) = 0 6318 futex(0x7f36f040ce54, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36f040ce50, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...> 6309 futex(0x7f36f040ce54, FUTEX_WAIT_PRIVATE, 133, NULL) = -1 EAGAIN (Resource temporarily unavailable) 6309 futex(0x7f36f040ce50, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> 6294 <... futex resumed> ) = 1 6294 futex(0x7f36f0070254, FUTEX_WAIT_PRIVATE, 121, NULL <unfinished ...> 6317 futex(0x7f36200c8d54, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...> 6318 <... futex resumed> ) = 1 6309 <... futex resumed> ) = 0 6318 futex(0x7f36200ca854, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...> 6309 futex(0x7f36f040ce50, FUTEX_WAKE_PRIVATE, 1) = 0 6309 futex(0x7f36f040ce28, FUTEX_WAKE_PRIVATE, 1) = 0 6309 futex(0x7f36f0070254, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36f0070250, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 6309 futex(0x7f36200ca854, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36200ca850, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 6318 <... futex resumed> ) = 0 6309 mmap(NULL, 1052672, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...> 6318 futex(0x7f36200ca828, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> 6309 <... mmap resumed> ) = 0x7f36662f9000 6318 <... futex resumed> ) = 0 6309 clone( <unfinished ...> 6318 mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6309 <... clone resumed> child_stack=0x7f36663f9210, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f36663f99e0, tls=0x7f36663f9910, child_tidptr=0x7f36663f99e0) = 6319 6319 set_robust_list(0x7f36663f99f0, 0x18 <unfinished ...> 6318 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6319 <... set_robust_list resumed> ) = 0 6318 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6319 gettid( <unfinished ...> 6318 <... mmap resumed> ) = 0x7f35f8000000 6319 <... gettid resumed> ) = 6319 6318 mprotect(0x7f35f8000000, 135168, PROT_READ|PROT_WRITE <unfinished ...> 6319 rt_sigprocmask(SIG_BLOCK, NULL, <unfinished ...> 6318 <... mprotect resumed> ) = 0 6319 <... rt_sigprocmask resumed> [QUIT], 8) = 0 6318 sched_getaffinity(6318, 32, <unfinished ...> 6319 rt_sigprocmask(SIG_UNBLOCK, [HUP INT ILL BUS FPE SEGV USR2 TERM], <unfinished ...> 6318 <... sched_getaffinity resumed> { f }) = 8 6319 <... rt_sigprocmask resumed> NULL, 8) = 0 6318 sched_getaffinity(6318, 32, <unfinished ...> 6319 rt_sigprocmask(SIG_BLOCK, [QUIT], <unfinished ...> 6318 <... sched_getaffinity resumed> { f }) = 8 6319 <... rt_sigprocmask resumed> NULL, 8) = 0 6318 mmap(0x7f36663fa000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0 <unfinished ...> 6319 futex(0x7f36f040ce54, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36f040ce50, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...> 6318 <... mmap resumed> ) = 0x7f36663fa000 6319 <... futex resumed> ) = 0 6318 mprotect(0x7f36663fa000, 12288, PROT_NONE <unfinished ...> 6319 futex(0x7f36200cc854, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...> 6318 <... mprotect resumed> ) = 0 6309 futex(0x7f36f040ce54, FUTEX_WAIT_PRIVATE, 135, NULL) = -1 EAGAIN (Resource temporarily unavailable) 6309 futex(0x7f36f040ce28, FUTEX_WAKE_PRIVATE, 1) = 0 6309 futex(0x7f36200cc854, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36200cc850, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 6319 <... futex resumed> ) = 0 6318 futex(0x7f36200ca854, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...> 6319 futex(0x7f36200cc828, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> 6309 mmap(NULL, 1052672, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...> 6319 <... futex resumed> ) = 0 6309 <... mmap resumed> ) = 0x7f36661f8000 6319 mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6309 clone( <unfinished ...> 6319 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6309 <... clone resumed> child_stack=0x7f36662f8210, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f36662f89e0, tls=0x7f36662f8910, child_tidptr=0x7f36662f89e0) = 6320 6320 set_robust_list(0x7f36662f89f0, 0x18 <unfinished ...> 6319 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6320 <... set_robust_list resumed> ) = 0 6319 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6320 gettid( <unfinished ...> 6319 mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6320 <... gettid resumed> ) = 6320 6319 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6320 rt_sigprocmask(SIG_BLOCK, NULL, <unfinished ...> 6319 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6320 <... rt_sigprocmask resumed> [QUIT], 8) = 0 6319 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6320 rt_sigprocmask(SIG_UNBLOCK, [HUP INT ILL BUS FPE SEGV USR2 TERM], <unfinished ...> 6309 futex(0x7f36f040ce54, FUTEX_WAIT_PRIVATE, 137, NULL <unfinished ...> 6320 <... rt_sigprocmask resumed> NULL, 8) = 0 6319 rt_sigaction(SIGSEGV, NULL, <unfinished ...> 6320 rt_sigprocmask(SIG_BLOCK, [QUIT], <unfinished ...> 6319 <... rt_sigaction resumed> {0x7f36f81f4a70, ~[KILL STOP RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, 8) = 0 6320 <... rt_sigprocmask resumed> NULL, 8) = 0 6319 rt_sigaction(SIGBUS, NULL, <unfinished ...> 6320 futex(0x7f36f040ce54, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36f040ce50, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...> 6319 <... rt_sigaction resumed> {0x7f36f81f4a70, ~[KILL STOP RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, 8) = 0 6320 <... futex resumed> ) = 1 6319 rt_sigaction(SIGSEGV, {0x7f36f831daf0, ~[RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, <unfinished ...> 6320 futex(0x7f36200ce754, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...> 6319 <... rt_sigaction resumed> {0x7f36f81f4a70, ~[KILL STOP RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, 8) = 0 6309 <... futex resumed> ) = 0 6319 rt_sigaction(SIGBUS, {0x7f36f831daf0, ~[RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, <unfinished ...> 6309 futex(0x7f36f040ce28, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> 6319 <... rt_sigaction resumed> {0x7f36f81f4a70, ~[KILL STOP RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3c2b00ee90}, 8) = 0 6309 <... futex resumed> ) = 0 6319 write(1, "#\n"..., 2 <unfinished ...> 6309 futex(0x7f36200ce754, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f36200ce750, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...> 6320 <... futex resumed> ) = 0 6319 <... write resumed> ) = 2 6320 futex(0x7f36200ce728, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> 6319 write(1, "# A fatal error has been detected"..., 67 <unfinished ...> 6309 <... futex resumed> ) = 1 6319 <... write resumed> ) = 67 6309 futex(0x7f36200ce728, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> 6320 <... futex resumed> ) = 0 6319 write(1, "#\n"..., 2 <unfinished ...> 6320 futex(0x7f36200ce728, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> 6319 <... write resumed> ) = 2 6320 <... futex resumed> ) = 0 6319 write(1, "# java.lang.OutOfMemoryError: "..., 30 <unfinished ...> 6320 mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6319 <... write resumed> ) = 30 6320 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6319 write(1, "pthread_getattr_np\n"..., 19 <unfinished ...> 6320 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6319 <... write resumed> ) = 19 6320 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6319 write(1, "#\n"..., 2 <unfinished ...> 6320 mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6319 <... write resumed> ) = 2 6320 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6319 write(1, "# "..., 3 <unfinished ...> 6320 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...> 6319 <... write resumed> ) = 3 6320 <... mmap resumed> ) = -1 ENOMEM (Cannot allocate memory) 6319 write(1, "Internal Error"..., 14 <unfinished ...> 6320 unlink("/tmp/hsperfdata_jjc/6288" <unfinished ...> 6319 <... write resumed> ) = 14 6309 <... futex resumed> ) = 1 6320 <... unlink resumed> ) = 0 6319 write(1, " (os_linux_x86.cpp:681)"..., 23 <unfinished ...> 6320 rt_sigprocmask(SIG_UNBLOCK, [ABRT], <unfinished ...> 6319 <... write resumed> ) = 23 6320 <... rt_sigprocmask resumed> NULL, 8) = 0 6319 write(1, ", pid=6288"..., 10 <unfinished ...> 6320 tgkill(6288, 6320, SIGABRT <unfinished ...> 6319 <... write resumed> ) = 10 6320 <... tgkill resumed> ) = 0 6319 write(1, ", tid=139871620405520"..., 21 <unfinished ...> 6320 --- SIGABRT (Aborted) @ 0 (0) --- 6319 <... write resumed> ) = 21 6309 mmap(NULL, 1052672, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...> 6318 +++ killed by SIGABRT +++ 6317 +++ killed by SIGABRT +++ 6316 +++ killed by SIGABRT +++ 6315 +++ killed by SIGABRT +++ 6314 +++ killed by SIGABRT +++ 6313 +++ killed by SIGABRT +++ 6312 +++ killed by SIGABRT +++ 6311 +++ killed by SIGABRT +++ 6310 +++ killed by SIGABRT +++ 6309 +++ killed by SIGABRT +++ 6308 +++ killed by SIGABRT +++ 6303 +++ killed by SIGABRT +++ 6302 +++ killed by SIGABRT +++ 6301 +++ killed by SIGABRT +++ 6300 +++ killed by SIGABRT +++ 6299 +++ killed by SIGABRT +++ 6298 +++ killed by SIGABRT +++ 6297 +++ killed by SIGABRT +++ 6296 +++ killed by SIGABRT +++ 6295 +++ killed by SIGABRT +++ 6294 +++ killed by SIGABRT +++ 6293 +++ killed by SIGABRT +++ 6292 +++ killed by SIGABRT +++ 6291 +++ killed by SIGABRT +++ 6290 +++ killed by SIGABRT +++ 6289 +++ killed by SIGABRT +++ 6288 +++ killed by SIGABRT +++ So basically, some mmaps are returning ENOMEM. I am not quite sure why this is happening, since there is 8GB of system ram, 10GB of swap and the ulimits are set as: $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) 4194304 scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 73728 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) 4194304 open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) 4194304 file locks (-x) unlimited
I think I now have a replicatable bug. If I remove the ulimit's I have on the data seg, max memory and virtual memory, the error goes away. ulimit -d unlimited ulimit -m unlimited ulimit -v unlimited If on the other hand I set the ulimit to be a small value such as: ulimit -S -v 2097152 and then try to run some java program: $ java -jar /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/demo/jfc/Notepad/Notepad.jar Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. Now, if I set an explicit memory size: $ java -Xmx256m -jar /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/demo/jfc/Notepad/Notepad.jar the notepad program runs. I think that both errors are related. This should work: ulimit -S -v 2097152 java -jar /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/demo/jfc/Notepad/Notepad.jar but it does not without a specific -Xmx flag. I can replicate the error now with: ulimit -S -v 1048576 java -Xmx256m -jar /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/demo/jfc/Notepad/Notepad.jar Basically, as I see it, the defect is that java looks at the amount of physical ram available and uses that to decide the amount of heap and stack size. Java should also take into account what the resource limits are and use the smaller of the resource limits or the physical memory.
I had this problem in Fedora 11, I just upgraded to Fedora 12 and I still have the problem. Trying to use eclipse IDE.
This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
In fedora 12, it still seems to not run properly, however, now I get: Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. instead of a java.lang.OutOfMemoryError.
While I have some sympathy with the reasoning in this bug report, it's something that should be taken up with the HotSpot maintainers. This is the way that the Java garbage collector works, and it would be inappropriate to change it locally in Fedora. Anyone who is using a custom value for ulimit must also use a custom value for -Xmx.