RFR - 8133249: Occasional SIGSEGV: non thread-safe use of strerr in getLastErrorString
ivan.gerasimov at oracle.com
Wed Sep 23 13:43:44 UTC 2015
Oops, I missed the reply from Roger Riggs, which already covered many of
On 23.09.2015 16:14, Ivan Gerasimov wrote:
> Hi Rob!
> On 21.09.2015 18:53, Rob McKenna wrote:
>> Hi folks,
>> Requesting a review of this change which switches corelibs usages of
>> the thread-unsafe strerror over to strerror_r/strerror_s:
> I think it would be better to have jdk_strerror(errno, tmpbuf,
> sizeof(tmpbuf)) instead of jdk_strerror(errno, tmpbuf, (size_t)
> 1024), just for the sake of avoiding constant duplication.
> I don't see the return code of jdk_strerror() is ever used. I suggest
> using it in ProcessImpl_md.c (see below), or just making this function
> return void.
> - why can't we just call jdk_strerror(errno, buf, len) and get rid
> of the temp buffer?
> - commented out #include @ line 26
> - the change in JLI_ReportErrorMessageSys() looks incomplete
> - would it make sense to check if jdk_strerror() == EINVAL instead of
> comparing the strings?
> - #include added, but no other changes were made.
> - buf is declared to be char, but only up to 255 chars are used.
> - would be better to move the buf declaration closer to its use, maybe
> next to char errmsg line?
> - minor nit: extra space after strerror_r at lines 46 and 63.
> Sincerely yours,
More information about the core-libs-dev