-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 20
-
Component/s: hotspot
-
b20
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8371203 | 17.0.18 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
After JDK-8294314, we would have signals_posix.cpp excluded with cast-function-type warning:
```
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp: In function 'int SR_initialize()':
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp:1727:20: error: cast between incompatible function types from 'void (*)(int, siginfo_t*, ucontext_t*)' to 'void (*)(int)' [-Werror=cast-function-type]
1727 | act.sa_handler = (void (*)(int)) SR_handler;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
```
A closer look would reveal that we are using the wrong slots for SR_handler, `sa_handler` vs `sig_handler`, which manifests in type cast errors. `man sigaction` says:
```
If SA_SIGINFO is specified in sa_flags, then sa_sigaction (instead of sa_handler) specifies the signal-handling
function for signum. This function receives three arguments, as described below.
```
```
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp: In function 'int SR_initialize()':
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp:1727:20: error: cast between incompatible function types from 'void (*)(int, siginfo_t*, ucontext_t*)' to 'void (*)(int)' [-Werror=cast-function-type]
1727 | act.sa_handler = (void (*)(int)) SR_handler;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
```
A closer look would reveal that we are using the wrong slots for SR_handler, `sa_handler` vs `sig_handler`, which manifests in type cast errors. `man sigaction` says:
```
If SA_SIGINFO is specified in sa_flags, then sa_sigaction (instead of sa_handler) specifies the signal-handling
function for signum. This function receives three arguments, as described below.
```
- backported by
-
JDK-8371203 Fix cast-function-type warnings in signal handling code
-
- Resolved
-
- relates to
-
JDK-8294314 Minimize disabled warnings in hotspot
-
- Resolved
-
-
JDK-8295125 os::signal should be os specific
-
- Resolved
-
- links to
-
Commit
openjdk/jdk/b06f1b14
-
Commit(master)
openjdk/jdk17u-dev/a3442fd7
-
Review
openjdk/jdk/10494
-
Review(master)
openjdk/jdk17u-dev/4125
(2 links to)