prosup at 163 dot com
2018-09-10 04:12:00 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23621
Bug ID: 23621
Summary: gdbserver can't intrrupt “SOME” process,kill(pid,2)
called by gdbserver didn't send SIGINT to
process,what's happening?
Product: gdb
Version: 7.10.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: prosup at 163 dot com
Target Milestone: ---
Envirment is:
target:x86_64 client,runs the program which striped
Host:x86_64 server ,has code,toolchain,striped program,symbles file for debug
on the target:
gdb attach to gdbserver(yes I can use gdb on the target right now,but the
target machine shall be released without gdb,symbles,etc. for size).
0x00000002 = SIGINT
some program will get the signalwhen gdbserver continue .
so,kill() is good for "SOME PROGRAM",not all.
And I'v use tcpdump monitored data between gdb/gdbserver.
If kill() worked (for "GOOD" program),gdbserver will send a packet to gdb.
I'v tried [sigmonitor](https://github.com/honkiko/signal-monitor),found out
gdbserver didn't send any sigal to "BAD program" in this case.but I can call
kill(pid,2) int gdbserver debuging gdb process
"BAD program" might be a multi-thread program ,more than 3 thread process can't
be stop,less than 3 is good.
Bug ID: 23621
Summary: gdbserver can't intrrupt “SOME” process,kill(pid,2)
called by gdbserver didn't send SIGINT to
process,what's happening?
Product: gdb
Version: 7.10.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: prosup at 163 dot com
Target Milestone: ---
Envirment is:
target:x86_64 client,runs the program which striped
Host:x86_64 server ,has code,toolchain,striped program,symbles file for debug
%gdbserver --multi :1234 </dev/null &> /pathtolog/gdb.log
./someprogram &
[1] PID
%gdb
(gdb)target extended-remote TARGETIP:1234
(gdb)file someprogram
(gdb)setrootfs pathtorootfs
(gdb)...//set lib path etc.
(gdb)attach PID
...//load everything as normal
...//stop somewhere
(gdb)c
^C^CThe target is not responding to interrupt requests.
Stop debugging it? (y or n)
tried to find the root cause:./someprogram &
[1] PID
%gdb
(gdb)target extended-remote TARGETIP:1234
(gdb)file someprogram
(gdb)setrootfs pathtorootfs
(gdb)...//set lib path etc.
(gdb)attach PID
...//load everything as normal
...//stop somewhere
(gdb)c
^C^CThe target is not responding to interrupt requests.
Stop debugging it? (y or n)
on the target:
gdb attach to gdbserver(yes I can use gdb on the target right now,but the
target machine shall be released without gdb,symbles,etc. for size).
(gdb) b kill
Breakpoint 1 at 0xf760afb0
(gdb) c
Continuing.
when press ctrl+c from host gdb ,gdbserver will break into the breakpointBreakpoint 1 at 0xf760afb0
(gdb) c
Continuing.
Breakpoint 1, 0xf760afb0 in kill () from /lib/libc.so.6
(gdb)
(gdb) x /32wx 0xffee8070
0xffee8070: 0xfffffe0c 0x00000002 0x00000001 0x00000000
0xfffffe0c = -PID(gdb)
(gdb) x /32wx 0xffee8070
0xffee8070: 0xfffffe0c 0x00000002 0x00000001 0x00000000
0x00000002 = SIGINT
some program will get the signalwhen gdbserver continue .
so,kill() is good for "SOME PROGRAM",not all.
And I'v use tcpdump monitored data between gdb/gdbserver.
If kill() worked (for "GOOD" program),gdbserver will send a packet to gdb.
I'v tried [sigmonitor](https://github.com/honkiko/signal-monitor),found out
gdbserver didn't send any sigal to "BAD program" in this case.but I can call
kill(pid,2) int gdbserver debuging gdb process
(gdb) call kill(PID,2)
then dmesg shows like this[11902.060722] ==========send_signal===========
SIG 2 to 6141[a.out], tgid=6141
...
SIG 19 to 6142[a.out], tgid=6141
[11902.111135] Task Tree of 6142 = {
...
---------------------------------------------------------------------SIG 2 to 6141[a.out], tgid=6141
...
SIG 19 to 6142[a.out], tgid=6141
[11902.111135] Task Tree of 6142 = {
...
"BAD program" might be a multi-thread program ,more than 3 thread process can't
be stop,less than 3 is good.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.