From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.bugs Subject: bug#16745: Can't send SIGTSTP from Emacs through GDB Date: Thu, 13 Feb 2014 14:33:14 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0149ce3cb9415904f24ec224 X-Trace: ger.gmane.org 1392320045 5387 80.91.229.3 (13 Feb 2014 19:34:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Feb 2014 19:34:05 +0000 (UTC) To: 16745@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 13 20:34:12 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WE232-0007lB-2x for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Feb 2014 20:34:12 +0100 Original-Received: from localhost ([::1]:48505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE231-00021v-Mm for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Feb 2014 14:34:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE22t-00021e-QZ for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:34:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE22s-0007TU-Bc for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:34:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE22s-0007TQ-7h for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WE22s-00011z-1K for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Barry OReilly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Feb 2014 19:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16745 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13923200113912 (code B ref -1); Thu, 13 Feb 2014 19:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Feb 2014 19:33:31 +0000 Original-Received: from localhost ([127.0.0.1]:51179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE22M-00010z-Ek for submit@debbugs.gnu.org; Thu, 13 Feb 2014 14:33:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49772) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE22K-00010j-DH for submit@debbugs.gnu.org; Thu, 13 Feb 2014 14:33:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE22E-0007GO-8w for submit@debbugs.gnu.org; Thu, 13 Feb 2014 14:33:23 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:51122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE22E-0007GK-5m for submit@debbugs.gnu.org; Thu, 13 Feb 2014 14:33:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE22A-0001m6-1T for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:33:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE228-0007Ec-Ek for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:33:17 -0500 Original-Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:55829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE228-0007EV-7y for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 14:33:16 -0500 Original-Received: by mail-ob0-f182.google.com with SMTP id wm4so12772720obc.13 for ; Thu, 13 Feb 2014 11:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=sMefSKJwP5AbRrWI3YyBsvQ4V7+9xj3Zn8SAm74IUcQ=; b=em9UxVYcdhG5rOF/5xzwGmF7LdyZQEjlEOF8cKEWMUTFs0ptbH+9tbLRU3r4k7SrUF KiEj29dUgtv2rVAH75pdFSbeBIDXyUBlDW+SkIc08LM66KHHYhObMVTKyKIjSs3WPpS3 P4dNRXvgE69Hp9/n2P5EJ48MgGXGAtaihkGP3t7S80m1ixenxiiCr4NAbK75FFU0Kd9o GAPDQcvSmvTvN1ESYcpE2xZH2732X9N1wEj4HDZ8AGKNyBUfnKFHTC2uWtq61b2Qr4ea riPNgyYygnM/UGL3X5l+FwbivS80wj+7y94qIqEi4iIp2JC2YmsLoNRSwArC42xGSly+ CxNg== X-Received: by 10.60.45.105 with SMTP id l9mr2626292oem.53.1392319995093; Thu, 13 Feb 2014 11:33:15 -0800 (PST) Original-Received: by 10.76.21.84 with HTTP; Thu, 13 Feb 2014 11:33:14 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85512 Archived-At: --089e0149ce3cb9415904f24ec224 Content-Type: text/plain; charset=ISO-8859-1 When running GDB in Emacs and sending SIGTSTP via C-c C-z to another Emacs ran under GDB, the Emacs under GDB does not appear to receive the SIGTSTP. Recipe: ./src/emacs -Q M-x gdb gdb -i=mi src/emacs run -Q C-c C-z [The Emacs under GDB is not stopped.] However, when I run GDB from the shell rather than from Emacs: gdb src/emacs run -Q C-z [The Emacs under GDB stopped.] I noticed src/.gdbinit has line: handle SIGTSTP nopass So I tried with and without this to no effect. When I run with these debug statements: diff --git a/src/process.c b/src/process.c index 85470b6..176de75 100644 --- a/src/process.c +++ b/src/process.c @@ -5753,6 +5753,9 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group, #else sig_char = &t.c_cc[VSUSP]; #endif + { struct timespec debug_ts; char debug_dateStr[20]; { clock_gettime(CLOCK_REALTIME, &debug_ts); struct tm mytm; localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateStr, 20, "%Y-%m-%dT%H:%M:%S", &mytm); } + printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: sig_char=%02x\n", // TODO: debugging + debug_dateStr, debug_ts.tv_nsec, getpid(), pthread_self(), __FILE__, __LINE__, *sig_char ); fflush(stdout); } break; } @@ -5901,6 +5904,9 @@ traffic. */) #ifndef SIGTSTP error ("No SIGTSTP support"); #else + { struct timespec debug_ts; char debug_dateStr[20]; { clock_gettime(CLOCK_REALTIME, &debug_ts); struct tm mytm; localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateStr, 20, "%Y-%m-%dT%H:%M:%S", &mytm); } + printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: Send SIGTSTP\n", // TODO: debugging + debug_dateStr, debug_ts.tv_nsec, getpid(), pthread_self(), __FILE__, __LINE__ ); fflush(stdout); } process_send_signal (process, SIGTSTP, current_group, 0); #endif return process; The output during the ill recipe is: 2014-02-13T14:11:49.438466000|pid:22430|tid:47532927609088|process.c|5909| DEBUG: Send SIGTSTP 2014-02-13T14:11:49.438547000|pid:22430|tid:47532927609088|process.c|5758| DEBUG: sig_char=1a So the signal is being sent it seems. What might be the obstruction? I am on RHEL 5, using latest Emacs from trunk and GDB 7.1. --089e0149ce3cb9415904f24ec224 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
When running GDB in Emacs and sending SIGTSTP via C-c= C-z to another
Emacs ran under GDB, the Emacs under GDB does not appear= to receive
the SIGTSTP.

Recipe:

=A0 ./src/emacs -Q
=A0= M-x gdb
=A0 gdb -i=3Dmi src/emacs
=A0 run -Q
=A0 C-c C-z
=A0 [The Emacs un= der GDB is not stopped.]

However, when I run GDB from the shell rath= er than from Emacs:

=A0 gdb src/emacs
=A0 run -Q
=A0 C-z
= =A0 [The Emacs under GDB stopped.]

I noticed src/.gdbinit has line:

=A0 handle SIGTSTP nopass
So I tried with and without this to no effect.

When I run with the= se debug statements:

diff --git a/src/process.c b/src/process.c
index 85470b6..176de75 100644
--- a/src/process.c
+++ b/src/process.c=
@@ -5753,6 +5753,9 @@ process_send_signal (Lisp_Object process, int sig= no, Lisp_Object current_group,
=A0#else
=A0=A0=A0=A0=A0=A0=A0=A0=A0 s= ig_char =3D &t.c_cc[VSUSP];
=A0#endif
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 { struct timespec debug_ts; char = debug_dateStr[20]; { clock_gettime(CLOCK_REALTIME, &debug_ts); struct t= m mytm; localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateSt= r, 20, "%Y-%m-%dT%H:%M:%S", &mytm); }
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf( "%s.%09ld|pid:%d|t= id:%ld|%s|%d| DEBUG: sig_char=3D%02x\n", // TODO: debugging
+=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 debug_dateStr, debug_ts.tv_nsec, getpid(), pthread_self(), = __FILE__, __LINE__, *sig_char ); fflush(stdout); }
=A0=A0=A0=A0=A0=A0=A0=A0=A0 break;
=A0=A0=A0=A0=A0=A0=A0 }
=A0
@@ = -5901,6 +5904,9 @@ traffic.=A0 */)
=A0#ifndef SIGTSTP
=A0=A0 error (&= quot;No SIGTSTP support");
=A0#else
+=A0 { struct timespec debug= _ts; char debug_dateStr[20]; { clock_gettime(CLOCK_REALTIME, &debug_ts)= ; struct tm mytm; localtime_r(&debug_ts.tv_sec, &mytm); strftime(de= bug_dateStr, 20, "%Y-%m-%dT%H:%M:%S", &mytm); }
+=A0=A0=A0=A0=A0=A0 printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: Sen= d SIGTSTP\n", // TODO: debugging
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 debug_dateStr, debug_ts.tv_nsec, ge= tpid(), pthread_self(), __FILE__, __LINE__ ); fflush(stdout); }
=A0=A0 process_send_signal (process, SIGTSTP, current_group, 0);
=A0#end= if
=A0=A0 return process;

The output during the ill recipe is:
2014-02-13T14:11:49.438466000|pid:22430|tid:47532927609088|process.c|5= 909| DEBUG: Send SIGTSTP
2014-02-13T14:11:49.438547000|pid:22430|tid:47532927609088|process.c|5758| = DEBUG: sig_char=3D1a

So the signal is being sent it seems. What migh= t be the obstruction?

I am on RHEL 5, using latest Emacs from = trunk and GDB 7.1.

--089e0149ce3cb9415904f24ec224--