Hi, Native gdb on mipsel board crashes at startup with an "unexpected signal" message ( this issue is not reproduced with gdbserver mipsel . ) Could it be this fix ? I saw a discussion on a patch : [PATCH] MIPS Linux signals http://sources.redhat.com/ml/gdb-patches/2012-06/msg00041.html is it integrated ? is it a similar issue ? If so, How can I download this fix ? ( I am not user friendly of svn / cvs. if you have detail , I am interested ... ) Best Regards, Frédéric
Patch mentioned only affects debugging core files, not use of gdbserver.
log error , # gdb /usr/bin/my_soft GNU gdb (GDB) 7.5.50.20120813 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mipsel-linux-uclibc". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/bin/my_soft ...done. (gdb) r Starting program: /usr/bin/my_soft GDB bug: target.c (gdb_signal_from_host): unrecognized real-time signal This is not reproduced on gdb target 7.3 It seems in gdb/common/signals.c , there was some code removed flagged in #ifndef GDBSERVER
The problem was introduced between 7.3 and 7.4, to be exact in commit 7ade46b0 in the official git mirror, a change set by Ulrich Weigand committed on Wed Apr 27 13:29:11 2011 +0000. On some platforms, such as Linux MIPS, NSIG is 128 and SIGRTMAX is also 128. However, there is no GDB_SIGNAL_REALTIME_128 constant, so target signal 128 is considered a real-time signal but not mappable to a GDB signal, which triggers the error condition in gdb_signal_from_host() in gdb/common/signals.c. I worked around the problem by mapping signal 128 to GDB_SIGNAL_UNKNOWN. See attached patch. I don't know if this can be considered a solution or whether introducing GDB_SIGNAL_REALTIME_128 would be preferred instead.
Created attachment 6621 [details] Patch for gdb 7.5 to map signal 128 to GDB_SIGNAL_UNKNOWN
Perfect ! That's exactly fix my issue. Thanks
The following commit in uClibc: http://git.uclibc.org/uClibc/commit/?id=2da958760f798224065508431787e3a83b7fe2ae Should prevent this problem from occurring after gdb is rebuilt against it. uClibc now matches glibc in defining __SIGRTMAX=127 instead of 128. Of course whether gdb should still understand SIG128 is a different question (since SIG128 has existed until now). Cheers James
The following patch is being discussed in the Linux kernel. <http://www.mail-archive.com/stable@vger.kernel.org/msg45489.html> It is related to this issue.
For the record, I have submitted a patch series which touches this code, and will likely cause the bug to reappear. The link to the specific MIPS patch is: <http://sourceware.org/ml/gdb-patches/2013-07/msg00014.html> I was strongly considering incrementing GDB's internal signal representation to accommodate the 128th realtime signal, and after reading this bug my willingness became stronger. I will keep posting updates to this bug as I discuss the matter with the community.