RFR (S) 8237591: Mac: include OS X version in hs_err_pid crash log file

Yasumasa Suenaga suenaga at oss.nttdata.com
Sat Jul 18 00:19:16 UTC 2020


Hi Gerard,

I cannot review it because I do not have and am not familiar for Mac, but I have some comments.


   - You set OS name to `os` with strncpy(), but can you use #define for them? For example:
       #ifdef __APPLE__
       #define OSNAME "Darwin"
       #elif defined __OpenBSD__
       #define OSNAME "OpenBSD"
       #else
       #define OSNAME "BSD"
       #endif

         :

        snprintf(buf, buflen, OSNAME " %s, macOS %s", os, release, osproductversion);


   - You can replace strncpy() to write '\0'
       strncpy(release, "", sizeof(release));  ->  release[0] = '\0';


Thanks,

Yasumasa


On 2020/07/18 4:19, gerard ziemski wrote:
> Hi all,
> 
> Please review this small fix that adds the OS version and the OS build number to the hs_err_pidXXX.log output in the “Summary” section for Mac platform (it’s easier to use for developers than the Darwin kernel version that we display right now).
> 
> This is how things used to look:
> 
> 
> --------------- S U M M A R Y ------------
> 
> Command Line: Crasher
> 
> Host: Gerards-MBP-16, MacBookPro16,1 x86_64 2600 MHz, 12 cores, 32G, Darwin 19.5.0
> Time: Thu Jul 16 14:01:46 2020 CDT elapsed time: 1.089465 seconds (0d 0h 0m 1s)
> 
> 
> And this is how the “Summary” section looks like with the proposed change:
> 
> 
> --------------- S U M M A R Y ------------
> 
> Command Line: Crasher
> 
> Host: Gerards-MBP-16, MacBookPro16,1 x86_64 2600 MHz, 12 cores, 32G, Darwin 19.5.0, macOS 10.15.5 (19F101)
> Time: Thu Jul 16 14:02:29 2020 CDT elapsed time: 0.360881 seconds (0d 0h 0m 0s)
> 
> 
> bug link at https://bugs.openjdk.java.net/browse/JDK-8237591
> open webrev at http://cr.openjdk.java.net/~gziemski/8237591_rev1
> testing Mach5 hs_tier1,2,3,4,5 in progress
> 
> 
> cheers
> 


More information about the hotspot-runtime-dev mailing list