Summary: | dev-java/commons-daemon-1.3.4 - jsvc-unix.c:1311:20: error: incompatible function pointer types assigning to '__sighandler_t' (aka 'void (*)(int)') from 'void (int, siginfo_t *, void *)' [-Wincompatible-function-pointer-types] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Java team <java> |
Status: | CONFIRMED --- | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 870412 | ||
Attachments: |
emerge-info.txt
dev-java:commons-daemon-1.3.4:20231130-104642.log emerge-history.txt environment etc.clang.tar.xz etc.portage.tar.xz logs.tar.xz qlist-info.txt |
Description
Toralf Förster
2023-11-30 17:27:15 UTC
Created attachment 875992 [details]
emerge-info.txt
Created attachment 875993 [details]
dev-java:commons-daemon-1.3.4:20231130-104642.log
Created attachment 875994 [details]
emerge-history.txt
Created attachment 875995 [details]
environment
Created attachment 875996 [details]
etc.clang.tar.xz
Created attachment 875997 [details]
etc.portage.tar.xz
Created attachment 875998 [details]
logs.tar.xz
Created attachment 875999 [details]
qlist-info.txt
Unless I'm too sleepy, this code is plain wrong. Line 1311 assigns the "controller" callback to act.sa_handler, which expects a pointer to a function taking a single int (like e.g. "handler", #89). When the signal handler function needs access to additional signal information and SA_SIGINFO is specified in act.sa_flags (#1313) the function must be assigned to act.sa_sigaction instead: diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c index e331a0f..187e404 100644 --- a/src/native/unix/native/jsvc-unix.c +++ b/src/native/unix/native/jsvc-unix.c @@ -1308,7 +1308,7 @@ static int run_controller(arg_data *args, home_data *data, uid_t uid, gid_t gid) * These will be replaced in the child process. */ memset(&act, '\0', sizeof(act)); - act.sa_handler = controller; + act.sa_sigaction = controller; sigemptyset(&act.sa_mask); act.sa_flags = SA_RESTART | SA_NOCLDSTOP | SA_SIGINFO; Doing so lets the file compile with clang. For more see man sigaction(2) "The siginfo_t argument to a SA_SIGINFO handler". Anybody going in there should probably also fix the "unused return value" warnings for extra credit. :) this is also with gcc-14, removing clang from summary |