add microcode version to the hs_err files

Thomas Stüfe thomas.stuefe at gmail.com
Fri Jul 17 21:26:16 UTC 2020


On Fri, Jul 17, 2020 at 11:19 PM Thomas Stüfe <thomas.stuefe at gmail.com>
wrote:

> Hi Vladimir,
>
> I think this would be more suited to hotspot-runtime.
>
>
> http://cr.openjdk.java.net/~sviswanathan/Vladimir/8249672/webrev.00/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp.udiff.html
>
> +#if defined(IA32) || defined(AMD64)
>
> Is that not synonymous with x86?
>
> +    while ((read = getline(&line, &len, fp)) != -1) {
> +      if (len > 10 && strstr(line, "microcode") != NULL) {
> +        char* rev = strchr(line, ':');
> +        if (rev != NULL) sscanf(rev + 1, "%x", &result);
> +        break;
> +      }
> +    }
> +    free(line);
>
> Not sure this works as intended. At the first call to getline() it will
> allocate a line buffer for you and return it. That buffer will be as large
> as the first line you happen to read. You then pass that same buffer into
> getline to fetch the next lines, but what if those are longer than the
> first?
>
>
Forget that point, getline calls realloc() on the line buffer to resize it,
so this should be okay.

Thanks, Thomas


> But anyway it would be better to pass a simple caller provided buffer in -
> stack allocated. Since this function is called at crash time and the C heap
> could be corrupted.
>
> Cheers, Thomas
>
>
> On Fri, Jul 17, 2020 at 10:22 PM Ivanov, Vladimir A <
> vladimir.a.ivanov at intel.com> wrote:
>
>> Hello,
>>
>> could you please review the patch
>> http://cr.openjdk.java.net/~sviswanathan/Vladimir/8249672/webrev.00/
>>
>> This patch add the microcode version for different OSes that may be
>> useful in the issue resolution process.
>>
>>
>>
>> The reported microcode version for different OSes loos as:
>>
>>
>>
>> Linux (RHEL7.7):
>>
>> # cat hs_err_pid251046.log |grep microc
>>
>> CPU: total 112 (initial active 112) (28 cores per cpu, 2 threads per
>> core) family 6 model 85 stepping 4 microcode 0x200005e, cmov, cx8, fxsr,
>> mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, vzeroupper, avx, avx2,
>> aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2,
>> adx, fma, clflush, clflushopt, clwb
>>
>>
>>
>> Windows (Win10, v1809):
>>
>> CPU: total 4 (initial active 4) (2 cores per cpu, 2 threads per core)
>> family 6 model 142 stepping 9 microcode 0xb4, cmov, cx8, fxsr, mmx, sse,
>> sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, vzeroupper, avx, avx2, aes,
>> clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx,
>> fma, clflush, clflushopt
>>
>>
>>
>> MacOS (Darwin):
>>
>> $ cat hs_err_pid95187.log |grep microc
>>
>> CPU: total 8 (initial active 8) (4 cores per cpu, 2 threads per core)
>> family 6 model 126 stepping 5 microcode 0x78, cmov, cx8, fxsr, mmx, sse,
>> sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, vzeroupper, avx, avx2, aes,
>> clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, sha,
>> fma, clflush, clflushopt
>>
>>
>>
>> Thanks, Vladimir
>>
>>
>>   Thanks, Vladimir
>>
>>


More information about the hotspot-runtime-dev mailing list