If SA fails to attach to a core file on linux or macosx, the only error message you get is:
Error attaching to core file: Can't attach to the core file
In order to figure out why the attach failed, what usually is done is to export LIBSAPROC_DEBUG=1 and try the attach again. This will provide a lot of debug info about the attach process, and usually include the reason for the failure. A recent example of this produced the following:
libsaproc DEBUG: address conflict @ 0x7fd5237f9fa0 (existing map size = 21311488, size = 21305808, flags = 5)
libsaproc DEBUG: can't read shared object's segments
Although not in itself a failure cause with an obvious solution, it is a start. Normally the failure is due to some sort of issue finding a dependent library, in which case the message is much more useful. Other common and easier to understand failure messages include:
can't open core file
core file is not a valid ELF ET_CORE file
can't open executable file
executable file is not a valid ELF file
The improvement I'm suggesting with this RFE is to include a hint about using LIBSAPROC_DEBUG=1. This will be something useful for users to try before reporting issues. If it doesn't lead them so a solution, it will at least be useful information for SA engineers. Also, as an SA engineer myself, I can never remember the name of this variable and have to look it up in the source. The following would be useful:
Error attaching to core file: Can't attach to the core file. For more info, export LIBSAPROC_DEBUG=1 and try again.
Error attaching to core file: Can't attach to the core file
In order to figure out why the attach failed, what usually is done is to export LIBSAPROC_DEBUG=1 and try the attach again. This will provide a lot of debug info about the attach process, and usually include the reason for the failure. A recent example of this produced the following:
libsaproc DEBUG: address conflict @ 0x7fd5237f9fa0 (existing map size = 21311488, size = 21305808, flags = 5)
libsaproc DEBUG: can't read shared object's segments
Although not in itself a failure cause with an obvious solution, it is a start. Normally the failure is due to some sort of issue finding a dependent library, in which case the message is much more useful. Other common and easier to understand failure messages include:
can't open core file
core file is not a valid ELF ET_CORE file
can't open executable file
executable file is not a valid ELF file
The improvement I'm suggesting with this RFE is to include a hint about using LIBSAPROC_DEBUG=1. This will be something useful for users to try before reporting issues. If it doesn't lead them so a solution, it will at least be useful information for SA engineers. Also, as an SA engineer myself, I can never remember the name of this variable and have to look it up in the source. The following would be useful:
Error attaching to core file: Can't attach to the core file. For more info, export LIBSAPROC_DEBUG=1 and try again.
- links to
-
Commit(master) openjdk/jdk/a22e932a
-
Review(master) openjdk/jdk/20800