Opened 12 years ago
Closed 12 years ago
#9046 closed bug (fixed)
kill -l command shows incorrect list of signals
Reported by: | Prasad | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Command Line Tools | Version: | R1/Development |
Keywords: | kill, signal | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
Running
kill -l
shows the following output
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGCHLD 6) SIGABRT 7) SIGPIPE 8) SIGFPE 9) SIGKILL 10) SIGSTOP 11) SIGSEGV 12) SIGCONT 13) SIGTSTP 14) SIGALRM 15) SIGTERM 16) SIGTTIN 17) SIGTTOU 18) SIGUSR1 19) SIGUSR2 20) SIGWINCH 21) SIGKILLTHR 22) SIGTRAP 23) SIGPOLL 24) SIGPROF 25) SIGSYS 26) SIGURG 27) SIGVTALRM 28) SIGXCPU 29) SIGXFSZ 30) DEBUG 31) ERR 32) RETURN 33) invalid signal number 34) invalid signal number 35) invalid signal number 36) invalid signal number 37) invalid signal number 38) invalid signal number 39) invalid signal number 40) invalid signal number 41) invalid signal number 42) invalid signal number 43) invalid signal number 44) invalid signal number 45) invalid signal number 46) invalid signal number 47) invalid signal number 48) invalid signal number 49) invalid signal number 50) invalid signal number 51) invalid signal number 52) invalid signal number 53) invalid signal number 54) invalid signal number 55) invalid signal number 56) invalid signal number 57) invalid signal number 58) invalid signal number 59) invalid signal number 60) invalid signal number 61) invalid signal number 62) invalid signal number 63) invalid signal number 64) invalid signal number
Apart from showing invalid signal number few signals like
SIGBUS
are not listed in the output
Running the command
kill -SIGBUS <pid>
shows
bash: kill: SIGBUS invalid signal specification
However, executing
kill -30 <pid>
command sends
SIGBUS
to the process
Attachments (1)
Change History (7)
follow-up: 2 comment:1 by , 12 years ago
follow-up: 3 comment:2 by , 12 years ago
Replying to Prasad:
This seems to be exact list reported on a Linux system, I mean, the signal name and position matches with Linux machine.
This is rather unsurprising since the tool was built and ran on Linux. I suspect on Haiku it would print better results.
AFAIK, this auto-generated list cannot be used, since Haiku uses few propitiatory signals like 'SIGKILLTHR' for example.
That and not all of the standard signals have the same value.
So the question I have is, How was the signames_haiku.h generated initially? was it auto-generated?
I don't recall. The respective commit says hand-edited, but it may have been generated on Haiku.
If it was not auto-generated, would it be okay if I manually edit the file and add SIGBUS at 30'th location?
The array needs quite a bit more editing, since the signal number has changed as well and real-time signals have been added. I guess the easiest solution is to generate the header on Haiku and verify that it looks OK.
comment:3 by , 12 years ago
Replying to bonefish:
Replying to Prasad:
This seems to be exact list reported on a Linux system, I mean, the signal name and position matches with Linux machine.
This is rather unsurprising since the tool was built and ran on Linux. I suspect on Haiku it would print better results.
AFAIK, this auto-generated list cannot be used, since Haiku uses few propitiatory signals like 'SIGKILLTHR' for example.
That and not all of the standard signals have the same value.
So the question I have is, How was the signames_haiku.h generated initially? was it auto-generated?
I don't recall. The respective commit says hand-edited, but it may have been generated on Haiku.
If it was not auto-generated, would it be okay if I manually edit the file and add SIGBUS at 30'th location?
The array needs quite a bit more editing, since the signal number has changed as well and real-time signals have been added. I guess the easiest solution is to generate the header on Haiku and verify that it looks OK.
Here is the diff of the header file generated on Haiku machine. This diff seems to be correct
prasad@pjoshi:~/sources/Haiku/haiku$ git diff diff --git a/src/bin/bash/signames_haiku.h b/src/bin/bash/signames_haiku.h index 8125c7a..784b80a 100644 --- a/src/bin/bash/signames_haiku.h +++ b/src/bin/bash/signames_haiku.h @@ -33,6 +33,41 @@ char *signal_names[NSIG + 4] = { "SIGVTALRM", "SIGXCPU", "SIGXFSZ", + "SIGBUS", + "SIGJUNK(31)", + "SIGJUNK(32)", + "SIGRTMIN", + "SIGRTMIN+1", + "SIGRTMIN+2", + "SIGRTMIN+3", + "SIGRTMAX-3", + "SIGRTMAX-2", + "SIGRTMAX-1", + "SIGRTMAX", + "SIGJUNK(41)", + "SIGJUNK(42)", + "SIGJUNK(43)", + "SIGJUNK(44)", + "SIGJUNK(45)", + "SIGJUNK(46)", + "SIGJUNK(47)", + "SIGJUNK(48)", + "SIGJUNK(49)", + "SIGJUNK(50)", + "SIGJUNK(51)", + "SIGJUNK(52)", + "SIGJUNK(53)", + "SIGJUNK(54)", + "SIGJUNK(55)", + "SIGJUNK(56)", + "SIGJUNK(57)", + "SIGJUNK(58)", + "SIGJUNK(59)", + "SIGJUNK(60)", + "SIGJUNK(61)", + "SIGJUNK(62)", + "SIGJUNK(63)", + "SIGJUNK(64)", "DEBUG", "ERR", "RETURN",
I will verify once and will attach a patch.
by , 12 years ago
Attachment: | 0001-Fix-mapping-between-signal-number-and-signal-string.patch added |
---|
comment:4 by , 12 years ago
patch: | 0 → 1 |
---|
comment:5 by , 12 years ago
Thanks for the patch. I applied it in hrev44683. I changed the commit message, though. It really doesn't need to be that verbose and shouldn't contain a longish proof of the bug and the fix. However it should contain the scope of the bug (bash, not "userland utilities") and ideally a mention what was wrong and why.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
As I understand the mapping from signal number to string kept in the file
The comment in the file suggest that the file is auto-generated using a tool mksignames.
Running the tool shows the following output
This seems to be exact list reported on a Linux system, I mean, the signal name and position matches with Linux machine.
AFAIK, this auto-generated list cannot be used, since Haiku uses few propitiatory signals like 'SIGKILLTHR' for example.
So the question I have is, How was the signames_haiku.h generated initially? was it auto-generated? If it was not auto-generated, would it be okay if I manually edit the file and add SIGBUS at 30'th location?