On some platforms, calls that do debug info decoding (e.g. dll_address_to_function_name()) may do File IO and therefore may be slow or may block. This is extremely rare but can happen on slow machines or OSes.
This may, for instance, cause problems when NMT does print a detailed report via jcmd, hangs and gets subsequently killed by the safepoint thread timeout watcher when concurrently someone attempts a safepoint:
```
Native frames: (J=compiled Java code, j=interpreted, V=VM code (C/C++), v=VM code (generated), C=native code)
C [libc.so.6+0xa5490] _IO_file_seek+0xffec1120 (sp=0x00003fff7f9ec960,pc=0x00003fffb0fb5490)
C [libc.so.6+0x99150] _IO_seekoff_unlocked+0xa0 (sp=0x00003fff7f9eca90,pc=0x00003fffb0fa9150)
C [libc.so.6+0xa1ba4] fseek+0xffebdbf4 (sp=0x00003fff7f9ecb30,pc=0x00003fffb0fb1ba4)
V [libjvm.so+0x11a5ad0] FileReader::set_position(long)+0x20 (sp=0x00003fff7f9ecbc0,pc=0x00003fffaf5a5ad0)
V [libjvm.so+0x11a7200] ElfFuncDescTable::lookup(unsigned int)+0xe0 (sp=0x00003fff7f9ecc40,pc=0x00003fffaf5a7200)
V [libjvm.so+0x11a7d1c] ElfSymbolTable::lookup(unsigned char*, int*, int*, int*, ElfFuncDescTable*)+0x5ac (sp=0x00003fff7f9ecd00,pc=0x00003fffaf5a7d1c)
V [libjvm.so+0x11a6b98] ElfFile::decode(unsigned char*, char*, int, int*)+0xa8 (sp=0x00003fff7f9ece20,pc=0x00003fffaf5a6b98)
V [libjvm.so+0x10f7768] ElfDecoder::decode(unsigned char*, char*, int, int*, char const*, bool)+0x168 (sp=0x00003fff7f9ecf00,pc=0x00003fffaf4f7768)
V [libjvm.so+0x10f6b08] Decoder::decode(unsigned char*, char*, int, int*, char const*, bool)+0x118 (sp=0x00003fff7f9ecfd0,pc=0x00003fffaf4f6b08)
V [libjvm.so+0x1a889a0] os::dll_address_to_function_name(unsigned char*, char*, int, int*, bool)+0x100 (sp=0x00003fff7f9ed0a0,pc=0x00003fffafe889a0)
V [libjvm.so+0x19fa074] NativeCallStack::print_on(outputStream*, int) const [clone .part.2] [clone .constprop.4]+0x84 (sp=0x00003fff7f9ed190,pc=0x00003fffafdfa074)
V [libjvm.so+0x1915688] MemDetailReporter::report_malloc_sites()+0x98 (sp=0x00003fff7f9ed660,pc=0x00003fffafd15688)
V [libjvm.so+0x1915a38] MemDetailReporter::report_detail()+0x58 (sp=0x00003fff7f9ed740,pc=0x00003fffafd15a38)
V [libjvm.so+0x1a1b31c] NMTDCmd::report(bool, unsigned long)+0x48c (sp=0x00003fff7f9ed7d0,pc=0x00003fffafe1b31c)
V [libjvm.so+0x1a1bf48] NMTDCmd::execute(DCmdSource, Thread*)+0x568 (sp=0x00003fff7f9ee0a0,pc=0x00003fffafe1bf48)
V [libjvm.so+0x117ff58] DCmd::parse_and_execute(DCmdSource, outputStream*, char const*, char, Thread*)+0x2a8 (sp=0x00003fff7f9ee160,pc=0x00003fffaf57ff58)
V [libjvm.so+0xb23d90] jcmd(AttachOperation*, outputStream*)+0x60 (sp=0x00003fff7f9ee2d0,pc=0x00003fffaef23d90)
V [libjvm.so+0xb2ab10] attach_listener_thread_entry(JavaThread*, Thread*)+0x540 (sp=0x00003fff7f9ee390,pc=0x00003fffaef2ab10)
V [libjvm.so+0x1f4b8b8] JavaThread::thread_main_inner()+0x2f8 (sp=0x00003fff7f9ee530,pc=0x00003fffb034b8b8)
V [libjvm.so+0x1f45504] Thread::call_run()+0xa4 (sp=0x00003fff7f9ee620,pc=0x00003fffb0345504)
V [libjvm.so+0x1a9697c] thread_native_entry(Thread*)+0x17c (sp=0x00003fff7f9ee6f0,pc=0x00003fffafe9697c)
C [libpthread.so.0+0xc460] start_thread+0x100 (sp=0x00003fff7f9ee7a0,pc=0x00003fffb118c460)
```
but there are other examples. It would probably be necessary to enter native state, or alternatively execute that command at a safepoint.
It would be nice to have a test switch that artificially blocks or delays elf file decoding, in order to flush out these places, and use that to add regression tests.
This may, for instance, cause problems when NMT does print a detailed report via jcmd, hangs and gets subsequently killed by the safepoint thread timeout watcher when concurrently someone attempts a safepoint:
```
Native frames: (J=compiled Java code, j=interpreted, V=VM code (C/C++), v=VM code (generated), C=native code)
C [libc.so.6+0xa5490] _IO_file_seek+0xffec1120 (sp=0x00003fff7f9ec960,pc=0x00003fffb0fb5490)
C [libc.so.6+0x99150] _IO_seekoff_unlocked+0xa0 (sp=0x00003fff7f9eca90,pc=0x00003fffb0fa9150)
C [libc.so.6+0xa1ba4] fseek+0xffebdbf4 (sp=0x00003fff7f9ecb30,pc=0x00003fffb0fb1ba4)
V [libjvm.so+0x11a5ad0] FileReader::set_position(long)+0x20 (sp=0x00003fff7f9ecbc0,pc=0x00003fffaf5a5ad0)
V [libjvm.so+0x11a7200] ElfFuncDescTable::lookup(unsigned int)+0xe0 (sp=0x00003fff7f9ecc40,pc=0x00003fffaf5a7200)
V [libjvm.so+0x11a7d1c] ElfSymbolTable::lookup(unsigned char*, int*, int*, int*, ElfFuncDescTable*)+0x5ac (sp=0x00003fff7f9ecd00,pc=0x00003fffaf5a7d1c)
V [libjvm.so+0x11a6b98] ElfFile::decode(unsigned char*, char*, int, int*)+0xa8 (sp=0x00003fff7f9ece20,pc=0x00003fffaf5a6b98)
V [libjvm.so+0x10f7768] ElfDecoder::decode(unsigned char*, char*, int, int*, char const*, bool)+0x168 (sp=0x00003fff7f9ecf00,pc=0x00003fffaf4f7768)
V [libjvm.so+0x10f6b08] Decoder::decode(unsigned char*, char*, int, int*, char const*, bool)+0x118 (sp=0x00003fff7f9ecfd0,pc=0x00003fffaf4f6b08)
V [libjvm.so+0x1a889a0] os::dll_address_to_function_name(unsigned char*, char*, int, int*, bool)+0x100 (sp=0x00003fff7f9ed0a0,pc=0x00003fffafe889a0)
V [libjvm.so+0x19fa074] NativeCallStack::print_on(outputStream*, int) const [clone .part.2] [clone .constprop.4]+0x84 (sp=0x00003fff7f9ed190,pc=0x00003fffafdfa074)
V [libjvm.so+0x1915688] MemDetailReporter::report_malloc_sites()+0x98 (sp=0x00003fff7f9ed660,pc=0x00003fffafd15688)
V [libjvm.so+0x1915a38] MemDetailReporter::report_detail()+0x58 (sp=0x00003fff7f9ed740,pc=0x00003fffafd15a38)
V [libjvm.so+0x1a1b31c] NMTDCmd::report(bool, unsigned long)+0x48c (sp=0x00003fff7f9ed7d0,pc=0x00003fffafe1b31c)
V [libjvm.so+0x1a1bf48] NMTDCmd::execute(DCmdSource, Thread*)+0x568 (sp=0x00003fff7f9ee0a0,pc=0x00003fffafe1bf48)
V [libjvm.so+0x117ff58] DCmd::parse_and_execute(DCmdSource, outputStream*, char const*, char, Thread*)+0x2a8 (sp=0x00003fff7f9ee160,pc=0x00003fffaf57ff58)
V [libjvm.so+0xb23d90] jcmd(AttachOperation*, outputStream*)+0x60 (sp=0x00003fff7f9ee2d0,pc=0x00003fffaef23d90)
V [libjvm.so+0xb2ab10] attach_listener_thread_entry(JavaThread*, Thread*)+0x540 (sp=0x00003fff7f9ee390,pc=0x00003fffaef2ab10)
V [libjvm.so+0x1f4b8b8] JavaThread::thread_main_inner()+0x2f8 (sp=0x00003fff7f9ee530,pc=0x00003fffb034b8b8)
V [libjvm.so+0x1f45504] Thread::call_run()+0xa4 (sp=0x00003fff7f9ee620,pc=0x00003fffb0345504)
V [libjvm.so+0x1a9697c] thread_native_entry(Thread*)+0x17c (sp=0x00003fff7f9ee6f0,pc=0x00003fffafe9697c)
C [libpthread.so.0+0xc460] start_thread+0x100 (sp=0x00003fff7f9ee7a0,pc=0x00003fffb118c460)
```
but there are other examples. It would probably be necessary to enter native state, or alternatively execute that command at a safepoint.
It would be nice to have a test switch that artificially blocks or delays elf file decoding, in order to flush out these places, and use that to add regression tests.