title: gdbserver can't intrrupt "SOME" process,kill(pid,2) called by gdbserver didn't send SIGINT to process,what's happening?
body: <p>Envirment is:</p>
  
  <p>target:x86_64 client,runs the program which is striped</p>
  
  <p>Host:x86_64 server ,has code,toolchain,striped program,symbles file for debug</p>
  
  <p>run gdbserver on target:</p>
  
  <blockquote>
    <p>%gdbserver --multi :1234  /pathtolog/gdb.log</p>
  </blockquote>
  
  <p>run program on target:</p>
  
  <blockquote>
    <p>./someprogram &amp;</p>
    
    <p>[1] PID</p>
  </blockquote>
  
  <p>run gdb on host:</p>
  
  <blockquote>
    <p>%gdb</p>
    
    <p>(gdb)target extended-remote TARGETIP:1234</p>
    
    <p>(gdb)file someprogram</p>
    
    <p>(gdb)setrootfs pathtorootfs</p>
    
    <p>(gdb)...//set lib path etc.</p>
    
    <p>(gdb)attach PID</p>
    
    <p>...//load everything as normal</p>
    
    <p>...//stop somewhere</p>
    
    <p>(gdb)c</p>
    
    <p>^C^CThe target is not responding to interrupt requests.</p>
    
    <p>Stop debugging it? (y or n)</p>
  </blockquote>
  
  <p>tried to find the root cause:</p>
  
  <p>on the target:</p>
  
  <p>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).</p>
  
  <blockquote>
    <p>(gdb) b kill</p>
    
    <p>Breakpoint 1 at 0xf760afb0</p>
    
    <p>(gdb) c</p>
    
    <p>Continuing.</p>
  </blockquote>
  
  <p>when press ctrl+c from host gdb ,gdbserver will break into the breakpoint</p>
  
  <blockquote>
    <p>Breakpoint 1, 0xf760afb0 in kill () from /lib/libc.so.6</p>
    
    <p>(gdb)</p>
  </blockquote>
  
  <p>I'v checked register,the %esp register shows like this:</p>
  
  <blockquote>
    <p>(gdb) x /32wx 0xffee8070</p>
    
    <p>0xffee8070:     0xfffffe0c      0x00000002      0x00000001      0x00000000</p>
  </blockquote>
  
  <p>0xfffffe0c = -PID
  0x00000002 = SIGINT</p>
  
  <p>some program will get the signalwhen gdbserver continue .
  so，kill() is good for "SOME PROGRAM",not all.</p>
  
  <p>And I'v use tcpdump monitored data between gdb/gdbserver.
  If kill() worked （for "GOOD" program),gdbserver will send a packet to gdb.</p>
  
  <p>I'v tried <a href="https://github.com/honkiko/signal-monitor" rel="nofollow noreferrer">sigmonitor</a>,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 </p>
  
  <blockquote>
    <p>(gdb) call kill(PID,2)</p>
  </blockquote>
  
  <p>then dmesg shows like this</p>
  
  <blockquote>
    <p>[11902.060722] ==========send_signal===========</p>
  
  <pre><code>          SIG 2 to 6141[a.out], tgid=6141
  </code></pre>
    
    <p>...</p>
  
  <pre><code>          SIG 19 to 6142[a.out], tgid=6141
  </code></pre>
    
    <p>[11902.111135] Task Tree of 6142 = {</p>
    
    <p>...</p>
  </blockquote>
  
  <p>Any ideas?</p>