RFR - 8133249: Occasional SIGSEGV: non thread-safe use of strerr in getLastErrorString

Roger Riggs Roger.Riggs at oracle.com
Mon Sep 21 18:14:37 UTC 2015


Hi Rob,

Some comments:

jdk_strerrror.c/.h:

- It seems like the existing jni_util_md.c getLastErrorString function 
provides the same function
   as jdk_strerror.  Then jdk_strerror could be an internal function and 
not require new files.
   The getLastErrorString is already exported from libjava.
   The Windows version of getLastErrorString is handled separately.
   Perhaps I'm missing some subtle dependency.


- the  "(size_t) 1024"  might be easier to maintain if it was "(sizeof 
tmpbuf)"  (*everywhere*)
   In the case of changing of the buffer size, it would only need to be 
changed in one place.


libjli/java_md_common.c: This edit seems incomplete, there are commented 
out lines.

src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c: has only an 
#include, no code changes

src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c: 
line 2218
     - the difference in the length between 255 and 300 is unmotivated.

Roger


On 09/21/2015 11:53 AM, 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:
>
> http://cr.openjdk.java.net/~robm/8133249/webrev.01/
>
>     -Rob
>




More information about the core-libs-dev mailing list