Quantcast

Unintentional abort with SIGUSR2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unintentional abort with SIGUSR2

Takao, Shinji-3
Hi all,

I encountered an unintentional process abort with SIGSEGV
when a Java process received a SIGUSR2.

I was little surprised because I believed that the SIGUSR2
was to be ignored when it had no user definition.

Is there any documentation for the behavior?


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fca804a40a2, pid=2137, tid=0x00007fca81949740
#
# JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x8700a2]
#
# Core dump written. Default location: /xxx/xxx/core or core.2137
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread is native thread

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000110



Best regards,
Shinji


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unintentional abort with SIGUSR2

Martin Buchholz-3
signal(7) documents the default behavior of Unix signals.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unintentional abort with SIGUSR2

Thomas Stüfe-2
In reply to this post by Takao, Shinji-3
This looks like a bug. I can reproduce it on Linux (slowdebug jdk10-hs):

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/os_linux.cpp:4014
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error
(/priv/d031900/openjdk/jdk10-hs/source/hotspot/src/os/linux/vm/os_linux.cpp:4014),
pid=17525, tid=17525
#  assert(thread != __null) failed: Missing current thread in SR_handler
#

...

 22 ---------------  T H R E A D  ---------------
 23
 24 Current thread is native thread
 25
 26 Stack: [0x00007ffc027f5000,0x00007ffc028f5000],  sp=0x00007ffc028ecb40,
 free space=990k
 27 Native frames: (J=compiled Java code, A=aot compiled Java code,
j=interpreted, Vv=VM code, C=native code)
 28 V  [libjvm.so+0x15449af]  VMError::report_and_die(int, char const*,
char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char
const*, int, unsigned long)+0x15f
 29 V  [libjvm.so+0x154580a]  VMError::report_and_die(Thread*, char const*,
int, char const*, char const*, __va_list_tag*)+0x4a
 30 V  [libjvm.so+0xa6312a]  report_vm_error(char const*, int, char const*,
char const*, ...)+0xea
 31 V  [libjvm.so+0x122de4a]  SR_handler(int, siginfo*, ucontext*)+0x14a
 32
 33


For me, it looks like the signal sent with kill() from the command line was
delivered to the primordial thread (pid == tid). That one was never
attached to the jvm and hence signal handling does not work there (for a
start, Thread::current() never got set).

Kind Regards, Thomas


On Tue, Mar 14, 2017 at 8:03 AM, Takao, Shinji <[hidden email]>
wrote:

> Hi all,
>
> I encountered an unintentional process abort with SIGSEGV
> when a Java process received a SIGUSR2.
>
> I was little surprised because I believed that the SIGUSR2
> was to be ignored when it had no user definition.
>
> Is there any documentation for the behavior?
>
>
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x00007fca804a40a2, pid=2137, tid=0x00007fca81949740
> #
> # JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build
> 1.8.0_121-b13)
> # Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64
> compressed oops)
> # Problematic frame:
> # V  [libjvm.so+0x8700a2]
> #
> # Core dump written. Default location: /xxx/xxx/core or core.2137
> #
> # If you would like to submit a bug report, please visit:
> #   http://bugreport.java.com/bugreport/crash.jsp
> #
>
> ---------------  T H R E A D  ---------------
>
> Current thread is native thread
>
> siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr:
> 0x0000000000000110
>
>
>
> Best regards,
> Shinji
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unintentional abort with SIGUSR2

David Holmes
In reply to this post by Takao, Shinji-3
On 14/03/2017 5:03 PM, Takao, Shinji wrote:
> Hi all,
>
> I encountered an unintentional process abort with SIGSEGV
> when a Java process received a SIGUSR2.
>
> I was little surprised because I believed that the SIGUSR2
> was to be ignored when it had no user definition.
>
> Is there any documentation for the behavior?

SIGUSR2 is used by the VM on Linux (and some other OS) to implement a  
suspend/resume protocol used by the event framework. It is not available  
for direct use. If you need to use it then you can change the SR_signum  
value by setting an env var:

  _JAVA_SR_SIGNUM=n

Documention is somewhat lacking - but better in JDK 9.

David
-----

>
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x00007fca804a40a2, pid=2137, tid=0x00007fca81949740
> #
> # JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
> # Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
> # Problematic frame:
> # V  [libjvm.so+0x8700a2]
> #
> # Core dump written. Default location: /xxx/xxx/core or core.2137
> #
> # If you would like to submit a bug report, please visit:
> #   http://bugreport.java.com/bugreport/crash.jsp
> #
>
> ---------------  T H R E A D  ---------------
>
> Current thread is native thread
>
> siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000110
>
>
>
> Best regards,
> Shinji
>
>
Loading...