RFR: 8242181: [Linux] Show source information when printing native stack traces in hs_err files [v5]

Thomas Stuefe stuefe at openjdk.java.net
Tue Mar 29 07:26:48 UTC 2022


On Mon, 28 Mar 2022 22:25:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/utilities/elfFile.cpp line 450:
>> 
>>> 448:   if (buf == nullptr) {
>>> 449:     return false;
>>> 450:   }
>> 
>> I'd move this close to and local to where it is used.
>> 
>> Also, you seem to repeat the same pattern a lot "NEW_RESOURCE_ARRAY(n), if error return something". I'd factor this out to an utility function or utility macro, maybe one where you pass the error return value as macro parameter.
>
> Thomas's comment caught my attention in the email. NEW_RESOURCE_ARRAY aborts the VM on OOM. Use NEW_RESOURCE_ARRAY_RETURN_NULL if you want to continue.

As I wrote in another comment, I'd rather we avoid RA altogether since it relies on Thread::current(), and we want to see callstacks even with Thread::current==NULL.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7126



More information about the build-dev mailing list