[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#669043: Program received signal ?, Unknown signal.



Package: gdb
Version: 7.0.1-2+b1
Severity: normal
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

When debugged process receives signal 32, 33 or 34, gdb prints an error
message without actual signal information:

  Program received signal ?, Unknown signal.

This happens because Glibc on GNU/kFreeBSD uses these signal numbers
internally (in LinuxThreads). As they have no associated macro name,
they need to be registered manually by their numbers.  See attached
patch.

This is only temporary so please don't forward the patch upstream.  When
we switch to NPTL we'll likely be able to use standarized macro names
from <bits/signum.h>.

-- System Information:
Debian Release: 6.0.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 8.1-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gdb depends on:
ii  libc0.1                 2.11.3-2         Embedded GNU C Library: Shared lib
ii  libexpat1               2.0.1-7          XML parsing C library - runtime li
ii  libkvm0                 8.1-5+squeeze1   FreeBSD kvm (kernel memory interfa
ii  libncurses5             5.7+20100313-5   shared libraries for terminal hand
ii  libpython2.6            2.6.6-8+b1       Shared Python runtime library (ver
ii  libreadline6            6.1-3            GNU readline and history libraries
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

gdb recommends no packages.

Versions of packages gdb suggests:
pn  gdb-doc                       <none>     (no description available)

-- no debconf information
int
main ()
{
  kill (getpid(), 34);
}
=== modified file 'gdb/common/signals.c'
--- gdb/common/signals.c	2012-04-16 11:24:47 +0000
+++ gdb/common/signals.c	2012-04-16 16:50:01 +0000
@@ -334,6 +334,15 @@ target_signal_from_host (int hostsig)
     return TARGET_SIGNAL_INFO;
 #endif
 
+#if defined(__GLIBC__) && defined(__FreeBSD_kernel__)
+  if (hostsig == 32)
+    return TARGET_SIGNAL_LINUXTHREADS_RESTART;
+  if (hostsig == 33)
+    return TARGET_SIGNAL_LINUXTHREADS_CANCEL;
+  if (hostsig == 34)
+    return TARGET_SIGNAL_LINUXTHREADS_DEBUG;
+#endif
+
 #if defined (REALTIME_LO)
   if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
     {

=== modified file 'include/gdb/signals.def'
--- include/gdb/signals.def	2012-04-16 11:24:47 +0000
+++ include/gdb/signals.def	2012-04-16 16:51:18 +0000
@@ -194,7 +194,11 @@ SET (TARGET_EXC_EMULATION, 148, "EXC_EMU
 SET (TARGET_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception")
 SET (TARGET_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
 
+SET (TARGET_SIGNAL_LINUXTHREADS_RESTART, 151, "32", "LinuxThreads restart signal")
+SET (TARGET_SIGNAL_LINUXTHREADS_CANCEL, 152, "33", "LinuxThreads cancel signal")
+SET (TARGET_SIGNAL_LINUXTHREADS_DEBUG, 153, "34", "LinuxThreads debug signal")
+
 /* If you are adding a new signal, add it just above this comment.  */
 
 /* Last and unused enum value, for sizing arrays, etc.  */
-SET (TARGET_SIGNAL_LAST, 151, NULL, "TARGET_SIGNAL_MAGIC")
+SET (TARGET_SIGNAL_LAST, 154, NULL, "TARGET_SIGNAL_MAGIC")


Reply to: