RFR 8237858: PlainSocketImpl.socketAccept() handles EINTR incorrectly
Vyom Tiwari
vyommani at gmail.com
Wed Jun 24 04:53:52 UTC 2020
Hi Daniel/Alan,
Thanks for the review , I was not sure how JVM/JDK handles the signals
that's why I installed my own signal handler. As you both pointed out, I
removed the custom signal handler in NativeThread.
Please find the latest webrev(
http://cr.openjdk.java.net/~vtewari/8237858/webrev0.5/index.html) where i
have incorporated most of the review comments.
Thanks,
Vyom
On Tue, Jun 23, 2020 at 5:47 PM Daniel Fuchs <daniel.fuchs at oracle.com>
wrote:
> Hi Vyom,
>
> Just to let you know that the new SocketAcceptInterruptTest test
> seems to have some stability issues. Patrick imported your test
> and ran it on our test system.
>
> We got one crash (SIGSEV) on macOS with the first @run that uses
> the old impl, and a timeout with the second @run that uses the new
> impl.
>
> I see that your test installs a signal handler that calls
> pthread_exit((void *)0); Is that really necessary?
> I am suspecting that this might be at the root cause of the crash.
>
> From the test output:
>
> run main/othervm/native -Djdk.net.usePlainSocketImpl=true
> SocketAcceptInterruptTest
> ----------System.out:(20/1144)----------
> Sending SIGPIPE to ServerSocket thread.
> Sending close Signal to server thread...
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # SIGSEGV (0xb) at pc=0x000000010399ac75, pid=30406, tid=12803
> #
> # JRE version: Java(TM) SE Runtime Environment (16.0) (build
> 16-internal+0-2020-06-22-1056440.patrick.concannon.openJDK)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM
> (16-internal+0-2020-06-22-1056440.patrick.concannon.openJDK, mixed mode,
> sharing, tiered, compressed oops, g1 gc, bsd-amd64)
> # Problematic frame:
> # V [libjvm.dylib+0x39ac75]
> _ZNK5frame28sender_for_interpreter_frameEP11RegisterMap+0x15
> #
>
> and in the hs_err file:
>
> --------------- T H R E A D ---------------
>
> Current thread (0x00007fe72b523270): GCTaskThread "GC Thread#0" [stack:
> 0x0000700006bc8000,0x0000700006cc8000] [id=12803]
>
> Stack: [0x0000700006bc8000,0x0000700006cc8000], sp=0x0000700006cc6a60,
> free space=1018k
> Native frames: (J=compiled Java code, A=aot compiled Java code,
> j=interpreted, Vv=VM code, C=native code)
> V [libjvm.dylib+0x39ac75]
> _ZNK5frame28sender_for_interpreter_frameEP11RegisterMap+0x15
> V [libjvm.dylib+0x39a99d] _ZNK5frame6senderEP11RegisterMap+0x4d
> V [libjvm.dylib+0x997f4e]
> _ZN10JavaThread11nmethods_doEP15CodeBlobClosure+0x9e
> V [libjvm.dylib+0x99973c]
> _ZN7Threads28possibly_parallel_threads_doEbP13ThreadClosure+0x8c
> V [libjvm.dylib+0x8b5c59] _ZN21ParallelSPCleanupTask4workEj+0x29
> V [libjvm.dylib+0xa3cc1d] _ZN10GangWorker4loopEv+0x4d
> V [libjvm.dylib+0x992ad1] _ZN6Thread8call_runEv+0x71
> V [libjvm.dylib+0x825177] _ZL19thread_native_entryP6Thread+0x197
> C [libsystem_pthread.dylib+0x3661] _pthread_body+0x154
> C [libsystem_pthread.dylib+0x350d] _pthread_body+0x0
> C [libsystem_pthread.dylib+0x2bf9] thread_start+0xd
>
>
> siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr:
> 0x0000700007dfa720
>
> =======================================================================
>
> For the second @run - the test failed in timeout:
>
> run main/othervm/native SocketAcceptInterruptTest
> ----------System.out:(3/107)----------
> Sending SIGPIPE to ServerSocket thread.
> Sending close Signal to server thread...
> Timeout refired 480 times
>
> best regards,
>
> -- daniel
>
> On 18/06/2020 09:02, Vyom Tiwari wrote:
> > Hi,
> > Please find the latest
> > webrev(http://cr.openjdk.java.net/~vtewari/8237858/webrev0.4/index.html)
>
> > where i fix the build issue as well.
> >
> > Thanks,
> > Vyom
> >
>
>
--
Thanks,
Vyom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200624/f9f5179f/attachment.htm>
More information about the net-dev
mailing list