Skip to content

Commit f37c3aa

Browse files
authored
Merge pull request #1632 from Sreekala-Gopakumar/1629SignalPID
Signaling pid included in javacore and tracepoints
2 parents 258241a + f7af84f commit f37c3aa

File tree

2 files changed

+63
-27
lines changed

2 files changed

+63
-27
lines changed

docs/openj9_signals.md

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# Signal handling
2525

26-
Signals used by the Eclipse OpenJ9™ VM include the following types:
26+
Signals that are used by the Eclipse OpenJ9™ VM include the following types:
2727

2828
- Exceptions (Exc): Raised synchronously by the operating system whenever an unrecoverable condition occurs (not applicable on Windows™ systems).
2929
- Errors (Err): Raised by the OpenJ9 VM when an unrecoverable condition occurs.
@@ -33,7 +33,7 @@ Signals used by the Eclipse OpenJ9™ VM include the following types:
3333
For exceptions and errors, if the VM cannot handle the condition and recover, dumps are produced and a controlled shut down sequence takes place. Interrupts also cause the VM to enter a controlled shut down sequence, but without generating dumps. The shutdown sequence is equivalent to calling `System.exit()`, which results in the following steps:
3434

3535
1. The VM calls the equivalent application signal handler.
36-
2. The VM calls any hooks installed by the application (unexpected shutdown hooks for exceptions or errors, shutdown or exit hooks for interrupts).
36+
2. The VM calls any hooks that are installed by the application (unexpected shutdown hooks for exceptions or errors, shutdown or exit hooks for interrupts).
3737
3. The VM does any final clean up.
3838

3939
Control signals are used for internal control purposes and do not cause the VM to end.
@@ -42,29 +42,55 @@ The VM takes control of any signals for Java™ threads. For non-Java thread
4242

4343
The signals relevant to each platform are detailed in the sections that follow.
4444

45-
When reading each table, a number supplied after the signal name is the standard numerical value for that signal.
45+
When reading each table, a number that is supplied after the signal name is the standard numerical value for that signal.
4646

4747
Note that certain signals on VM threads cause OpenJ9 to shutdown. An application signal handler should not attempt to recover from these signals unless it no longer requires the VM.
4848

49+
On all platforms except Windows, when an asynchronous signal `SIGABRT`, `SIGQUIT`, or `SIGUSR2` occurs, the process ID (pid) and the name of the process that sent the signal is recorded and reported in a tracepoint. While `SIGABRT` creates a tracepoint, `SIGQUIT` and `SIGUSR2` might or might not create a tracepoint. For example, `SIGABRT` creates a `j9dmp.16` tracepoint with the following content that includes the pid and the process name:
50+
51+
```
52+
j9dmp.16 - SIGABRT received from process id 608 name '/usr/bin/bash'
53+
```
54+
`SIGQUIT`, `SIGUSR2` might create a tracepoint `j9jcl.540` with similar content.
55+
56+
The sending pid information for these signals is also reported in the javacore. For example,
57+
58+
```
59+
1TISIGPID Signalling process id 608 name "/usr/bin/bash"
60+
```
61+
The `SIGINT`, `SIGHUP`, and `SIGTERM` signals create a tracepoint that includes the pid but these signals do not create javacore files.
62+
63+
```
64+
j9vm.807 - SIGTERM received from process id 601 name '/usr/bin/bash'
65+
```
66+
67+
On the z/OS® platform, the pid is included in the tracepoint and reported in the javacore but the process name is not included. For example,
68+
69+
```
70+
j9dmp.16 - SIGABRT received from process id 608
71+
```
72+
4973
## Signals on Linux
5074

5175
| Signal | Type | Description | Option to disable signal |
5276
| ------------------|------|--------------------------------------------------------------------|-----------------------|
5377
| `SIGBUS (7)` | Exc | Incorrect memory access (data misalignment) | `-Xrs` or `-Xrs:sync` |
54-
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
55-
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction) | `-Xrs` or `-Xrs:sync` |
5678
| `SIGFPE (8)` | Exc | Floating point exception (divide by zero) | `-Xrs` or `-Xrs:sync` |
79+
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction) | `-Xrs` or `-Xrs:sync` |
80+
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
5781
| `SIGABRT (6)` | Err | Abnormal termination, raised by the VM when a VM fault is detected | `-Xrs` or `-Xrs:sync` |
82+
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
5883
| `SIGINT (2)` | Int | Interactive attention (CTRL-C), VM exits normally | `-Xrs` |
5984
| `SIGTERM (15)` | Int | Termination request, VM exits normally | `-Xrs` |
60-
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
6185
| `SIGUSR2 (12)` | Int | User-defined signal for triggering a dump agent | `-Xrs` |
86+
| `SIGCHLD (17)` | Con | Used by the `java.lang.Process` implementation | - |
6287
| `SIGQUIT (3)` | Con | Quit signal from a terminal, which triggers a Java dump by default | `-Xrs` |
63-
| `SIGTRAP (5)` | Con | Used by the JIT | `-Xrs` or `-Xrs:sync` |
88+
| `SIGRTMAX -2 (62)`| Con | Used by the `java.net` class library code | - |
6489
| `SIGRTMIN (34)` | Con | Used by the VM for thread introspection | - |
6590
| `SIGRTMIN +1 (35)`| Con | Used by the VM for Runtime Instrumentation (Linux for IBM Z® systems only)| - |
66-
| `SIGRTMAX -2 (62)`| Con | Used by the `java.net` class library code | - |
67-
| `SIGCHLD (17)` | Con | Used by the `java.lang.Process` implementation | - |
91+
| `SIGTRAP (5)` | Con | Used by the JIT | `-Xrs` or `-Xrs:sync` |
92+
93+
6894

6995
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Notes:**
7096

@@ -77,19 +103,19 @@ Note that certain signals on VM threads cause OpenJ9 to shutdown. An application
77103
| Signal | Type | Description | Option to disable signal |
78104
| ------------------|------|--------------------------------------------------------------------|-----------------------|
79105
| `SIGBUS (10)` | Exc | Incorrect memory access (data misalignment) | `-Xrs` or `-Xrs:sync` |
80-
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
81-
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
82106
| `SIGFPE (8)` | Exc | Floating point exception (divide by zero) | `-Xrs` or `-Xrs:sync` |
107+
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
108+
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
83109
| `SIGABRT (6)` | Err | Abnormal termination, raised by the VM when a VM fault is detected | `-Xrs` or `-Xrs:sync` |
110+
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
84111
| `SIGINT (2)` | Int | Interactive attention (CTRL-C), VM exits normally | `-Xrs` |
85112
| `SIGTERM (15)` | Int | Termination request, VM exits normally | `-Xrs` |
86-
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
87113
| `SIGUSR2 (31)` | Int | User-defined signal for triggering a dump agent | `-Xrs` |
114+
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
88115
| `SIGQUIT (3)` | Con | Quit signal from a terminal, which triggers a Java dump by default | `-Xrs` |
116+
| `SIGIO (23)` | Con | Used by the `java.net` class library code | - |
89117
| `SIGTRAP (5)` | Con | Used by the JIT | `-Xrs` or `-Xrs:sync` |
90-
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
91118
| `SIGUSR1 (30)` | Con | Used by the VM for thread introspection | - |
92-
| `SIGIO (23)` | Con | Used by the `java.net` class library code | - |
93119

94120
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Note:**
95121

@@ -108,28 +134,28 @@ Note that certain signals on VM threads cause OpenJ9 to shutdown. An application
108134

109135
The following mechanisms are used by OpenJ9 for signal handling:
110136

111-
- structured exception handling (32-bit VM only)
137+
- Structured exception handling (32-bit VM only)
112138
- `AddVectoredExceptionHandler()` API (64-bit JVM only)
113139
- `SetConsoleCtrlHandler()` applicable
114140

115-
All mechanisms can be disabled by using the `-Xrs` option. However, only structured exception handling and the use of the `AddVectoredExceptionHandler()` API can be disabled by using the `-Xrs:sync` option. The option `-Xnosigchain`, which turns off signal handler chaining, is ignored on Windows systems.
141+
All mechanisms can be disabled by using the `-Xrs` option. However, only structured exception handling and the use of the `AddVectoredExceptionHandler()` API can be disabled by using the `-Xrs:sync` option. The option `-Xnosigchain`, which turns off signal handler chaining, is ignored on Windows systems.
116142

117143
## Signals on z/OS
118144

119145
| Signal | Type | Description | Option to disable signal |
120146
| ------------------|------|--------------------------------------------------------------------|-----------------------|
121147
| `SIGBUS (10)` | Exc | Incorrect memory access (data misalignment) | `-Xrs` or `-Xrs:sync` |
122-
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
123-
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
124148
| `SIGFPE (8)` | Exc | Floating point exception (divide by zero) | `-Xrs` or `-Xrs:sync` |
149+
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
150+
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
125151
| `SIGABRT (3)` | Err | Abnormal termination, raised by the VM when a VM fault is detected | `-Xrs` or `-Xrs:sync` |
152+
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
126153
| `SIGINT (2)` | Int | Interactive attention (CTRL-C), VM exits normally | `-Xrs` |
127154
| `SIGTERM (15)` | Int | Termination request, VM exits normally | `-Xrs` |
128-
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
129155
| `SIGUSR2 (17)` | Int | User-defined signal for triggering a dump agent | `-Xrs` |
156+
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
130157
| `SIGQUIT (24)` | Con | Quit signal from a terminal, triggers a Java dump by default | `-Xrs` |
131158
| `SIGTRAP (26)` | Con | Used by the JIT | `-Xrs` or `-Xrs:sync` |
132-
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
133159
| `SIGUSR1 (16)` | Con | Used by the `java.net` class library code | - |
134160

135161
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Note:**
@@ -142,21 +168,21 @@ All mechanisms can be disabled by using the `-Xrs` option. However, only structu
142168
| Signal | Type | Description | Option to disable signal |
143169
| ------------------|------|--------------------------------------------------------------------|-----------------------|
144170
| `SIGBUS (10)` | Exc | Incorrect memory access (data misalignment) | `-Xrs` or `-Xrs:sync` |
145-
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
146-
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
147171
| `SIGFPE (8)` | Exc | Floating point exception (divide by zero) | `-Xrs` or `-Xrs:sync` |
172+
| `SIGILL (4)` | Exc | Illegal instruction (attempt to call unknown machine instruction)) | `-Xrs` or `-Xrs:sync` |
173+
| `SIGSEGV (11)` | Exc | Incorrect memory access (write to inaccessible area) | `-Xrs` or `-Xrs:sync` |
148174
| `SIGABRT (6)` | Err | Abnormal termination, raised by the VM when a VM fault is detected | `-Xrs` or `-Xrs:sync` |
175+
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
149176
| `SIGINT (2)` | Int | Interactive attention (CTRL-C), VM exits normally | `-Xrs` |
150177
| `SIGTERM (15)` | Int | Termination request, VM exits normally | `-Xrs` |
151-
| `SIGHUP (1)` | Int | Hang up, VM exits normally | `-Xrs` |
152178
| `SIGUSR2 (31)` | Int | User-defined signal for triggering a dump agent | `-Xrs` |
153-
| `SIGQUIT (3)` | Con | Triggers a Java dump by default | `-Xrs` |
154179
| `No Name (40)` | Con | Used by the VM for control purposes | `-Xrs` |
180+
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
181+
| `SIGQUIT (3)` | Con | Triggers a Java dump by default | `-Xrs` |
155182
| `SIGRECONFIG (58)`| Con | Reserved to detect changes to resources (CPUs, processing capacity, or physical memory)| `-Xrs` |
156183
| `SIGTRAP (5)` | Con | Used by the JIT | `-Xrs` or `-Xrs:sync` |
157-
| `SIGRTMIN (50)` | Con | Used by the VM for thread introspection | - |
158184
| `SIGRTMAX -1 (56)`| Con | Used by the `java.net` class library code | - |
159-
| `SIGCHLD (20)` | Con | Used by the `java.lang.Process` implementation | - |
185+
| `SIGRTMIN (50)` | Con | Used by the VM for thread introspection | - |
160186

161187
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Notes:**
162188

@@ -174,7 +200,7 @@ command line syntax to use with the compiler, where available:
174200

175201
|Operating system | Shared library | Method for linking |
176202
|------------------------|----------------|--------------------|
177-
| Linux&reg;, macOS&reg;, and z/OS&reg; | `libjsig.so` | `gcc -L$JAVA_HOME/bin -ljsig -L$JAVA_HOME/lib/j9vm -ljvm <java_application>.c` |
203+
| Linux&reg;, macOS&reg;, and z/OS | `libjsig.so` | `gcc -L$JAVA_HOME/bin -ljsig -L$JAVA_HOME/lib/j9vm -ljvm <java_application>.c` |
178204
| Windows | `jsig.dll` | Link the DLL with the application that creates or embeds a VM |
179205
| AIX | `libjsig.so` | `cc_r [-q64] <other_compile/link_parameter> -L<java_install_dir> -ljsig -L<java_install_dir>/lib/j9vm -ljvm <java_application>.c` |
180206

@@ -194,5 +220,6 @@ environment variable as an alternative method to the command line for linking th
194220
- [-Xsigcatch](xsigcatch.md)
195221
- [-Xsigchain](xsigchain.md)
196222
- [-Xsignal (z/OS only)](xsignal.md)
223+
- [What's new in version 0.57.0](version0.57.md#the-signaling-process-id-and-process-name-are-recorded-and-reported-in-tracepoints-and-javacore)
197224

198225
<!-- ==== END OF TOPIC ==== openj9_signals.md ==== -->

docs/version0.57.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The following new features and notable changes since version 0.56.0 are included
2727

2828
- [New binaries and changes to supported environments](#binaries-and-supported-environments)
2929
- [The `zlib` library bundled on all Linux platforms except Linux on IBM Z](#the-zlib-library-bundled-on-all-linux-platforms-except-linux-on-ibm-z)
30+
- [The signaling process ID and process name are recorded and reported in tracepoints and javacore](#the-signaling-process-id-and-process-name-are-recorded-and-reported-in-tracepoints-and-javacore)
3031

3132
## Features and changes
3233

@@ -42,6 +43,14 @@ The `zlib` compression library is now bundled on all Linux&reg; platforms except
4243

4344
For more information on hardware-accelerated data compression and decompression, see [Hardware acceleration](introduction.md#hardware-acceleration).
4445

46+
### The signaling process ID and process name are recorded and reported in tracepoints and javacore
47+
48+
On all platforms except Windows&trade;, when an asynchronous signal `SIGABRT`, `SIGQUIT`, or `SIGUSR2` occurs, the process ID (pid) and the name of the process that sent the signal is recorded and reported in a tracepoint and in the javacore.
49+
50+
The `SIGINT`, `SIGHUP`, and `SIGTERM` signals create a tracepoint that includes the pid but these signals do not create javacore files.
51+
52+
For more information, see [Signal handling](openj9_signals.md).
53+
4554
## Known problems and full release information
4655

4756
To see known problems and a complete list of changes between Eclipse OpenJ9 v0.56.0 and v0.57.0 releases, see the [Release notes](https://github.com/eclipse-openj9/openj9/blob/master/doc/release-notes/0.57/0.57.md).

0 commit comments

Comments
 (0)