Code Review Request: 8020498: Crash when both libnet.so and libmawt.so are loaded
Kurchi Hazra
kurchi.subhra.hazra at oracle.com
Thu Jul 18 10:55:09 PDT 2013
Hi Chris,
Thanks for the additional information. How about this fix:
http://cr.openjdk.java.net/~khazra/8020498/webrev.01/
- Kurchi
On 7/18/2013 2:44 AM, Chris Hegarty wrote:
> On 18/07/2013 01:19, Kurchi Hazra wrote:
>>
>> Hi,
>>
>> We are seeing a crash when both libmawt.so and libnet.so are loaded, and
>> the init()
>> method in src/share/native/java/net/net_util.c is called, but an init()
>> method in
>> libmawt.so gets invoked instead. Although it is difficult to reproduce
>> the problem,
>> declaring the init() in net_util.c can resolve the issue.
>
> Thanks Kurchi,
>
> I have seen this, what appears to be a bizarre linking issue, a few
> times now over the past year but was unable to get to the bottom of it.
>
> Snipped of a stacktrace and comment from 8005450 ( I was unable to get
> the bottom of it, or reproduce ).
> ---
> This looks like a strange linking issue. Relevant part of the stack
> below.
> ...
> C [libmawt.so+0x26c12] init+0x8e;; init+0x8e
> C [libnet.so+0x8b53] NET_SockaddrToInetAddress+0x23;;
> NET_SockaddrToInetAddress+0x23
> C [libnet.so+0xc388]
> Java_java_net_PlainSocketImpl_socketAccept+0x41c;;
> Java_java_net_PlainSocketImpl_socketAccept+0x41c
> j java.net.PlainSocketImpl.socketAccept(Ljava/net/SocketImpl;)V+0
> ...
>
> NET_SockaddrToInetAddress is somehow triggering libmawt init() to be
> called. NET_SockaddrToInetAddress does call a local init() function,
> that is defined within net_util.c, but it is as if the linker has
> decided to call libmawt init().
> ---
>
> I think your fix is probably ok, but I wonder if we should air on the
> side of caution and maybe give this function a unique name, say
> initInetAddrs ( or something similar ).
>
> -Chris.
>
>
>>
>> This low-risk fix will hopefully be going into 7u40.
>>
>>
>> Bug: http://bugs.sun.com/view_bug.do?bug_id=8020498
>> Webrev: http://cr.openjdk.java.net/~khazra/8020498/webrev.00/
>>
>> Thanks,
>> Kurchi
More information about the net-dev
mailing list