Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V2] gdb: gdbserver: update ctrl-c handling
@ 2018-09-19  2:26 Zhixiong Chi
  2018-09-19  2:32 ` ✗ patchtest: failure for gdb: gdbserver: update ctrl-c handling (rev2) Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Zhixiong Chi @ 2018-09-19  2:26 UTC (permalink / raw)
  To: openembedded-core

A) gdbserver sends SIGINT not to the process, but to the process
group (-signal_pid). But the attached process is not always a
process group leader. If not, "kill (-signal_pid, SIGINT)" returns
error and fails to interrupt the attached process. We cannot interrupt
the process attached with gdbserver who is not a process group leader.

This problem was created by the gdb upstream commit 78708b7c8c
The commit fixed the following case B) bug.
B) We cannot interrupt the process attached with gdbserver whose
main thread exits (pthread_exit()).

Now this patch can solve both A) and B).

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
---
 meta/recipes-devtools/gdb/gdb-8.2.inc         |  1 +
 .../gdb/gdb/gdbserver-ctrl-c-handling.patch   | 26 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch

diff --git a/meta/recipes-devtools/gdb/gdb-8.2.inc b/meta/recipes-devtools/gdb/gdb-8.2.inc
index 999fdde031..dfb0059123 100644
--- a/meta/recipes-devtools/gdb/gdb-8.2.inc
+++ b/meta/recipes-devtools/gdb/gdb-8.2.inc
@@ -16,6 +16,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
            file://0009-Change-order-of-CFLAGS.patch \
            file://0010-resolve-restrict-keyword-conflict.patch \
            file://0011-Fix-invalid-sigprocmask-call.patch \
+           file://gdbserver-ctrl-c-handling.patch \
 "
 SRC_URI[md5sum] = "b5a49dbff00d9a87fbe114d14b3101c0"
 SRC_URI[sha256sum] = "c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39"
diff --git a/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch b/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch
new file mode 100644
index 0000000000..d1ff5a5d75
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch
@@ -0,0 +1,26 @@
++This problem was created by the upstream commit 78708b7c8c
++After applying the commit, it will send SIGINT to the process group(-signal_pid).
++But if we use gdbserver send SIGINT, and the attached process is not a process
++group leader, then the "kill (-signal_pid, SIGINT)" returns error and fails  to
++interrupt the attached process.
++
++Upstream-Status: Submitted
++[https://sourceware.org/bugzilla/show_bug.cgi?id=18945]
++
++Author: Josh Gao
++Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Index: gdb-8.2/gdb/gdbserver/linux-low.c
+===================================================================
+--- gdb-8.2.orig/gdb/gdbserver/linux-low.c
++++ gdb-8.2/gdb/gdbserver/linux-low.c
+@@ -5940,9 +5940,7 @@ linux_look_up_symbols (void)
+ static void
+ linux_request_interrupt (void)
+ {
+-  /* Send a SIGINT to the process group.  This acts just like the user
+-     typed a ^C on the controlling terminal.  */
+-  kill (-signal_pid, SIGINT);
++  kill (signal_pid, SIGINT);
+ }
+ 
+ /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* ✗ patchtest: failure for gdb: gdbserver: update ctrl-c handling (rev2)
  2018-09-19  2:26 [PATCH V2] gdb: gdbserver: update ctrl-c handling Zhixiong Chi
@ 2018-09-19  2:32 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2018-09-19  2:32 UTC (permalink / raw)
  To: Zhixiong Chi; +Cc: openembedded-core

== Series Details ==

Series: gdb: gdbserver: update ctrl-c handling (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/14110/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Upstream-Status is Submitted, but it is not mentioned where [test_upstream_status_presence_format] 
  Suggested fix    Include where gdbserver-ctrl-c-handling.patch was submitted
  Current          Upstream-Status: Submitted
  Standard format  Upstream-Status: Submitted [where]



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-19  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-19  2:26 [PATCH V2] gdb: gdbserver: update ctrl-c handling Zhixiong Chi
2018-09-19  2:32 ` ✗ patchtest: failure for gdb: gdbserver: update ctrl-c handling (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox