Code Review Request: 8020498: Crash when both libnet.so and libmawt.so are loaded

Chris Hegarty chris.hegarty at oracle.com
Thu Jul 18 11:19:36 PDT 2013


On 18 Jul 2013, at 19:14, Kurchi Hazra <kurchi.subhra.hazra at oracle.com> wrote:

> Alright, I'll add it before asking for approval from 7u-dev.
> 
> - Kurchi
> 
> On 7/18/2013 11:11 AM, Dmitry Samersoff wrote:
>> Kurchi,
>> 
>> As you don't plan to use this function outside of net_util.c it's better
>> to add static keyword as well.

Agreed. No need to regenerate the webrev, consider this reviewed.

-Chris.

>> 
>> -Dmitry
>> 
>> On 2013-07-18 21:55, Kurchi Hazra wrote:
>>> 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