This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/19558] New: Trying to attach the same process twice borks gdbserver


https://sourceware.org/bugzilla/show_bug.cgi?id=19558

            Bug ID: 19558
           Summary: Trying to attach the same process twice borks
                    gdbserver
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com
  Target Milestone: ---

Trying to attach to the same process twice (a bad manipulation from the user)
leads to gdbserver's internal state to be messed up.

I started gdbserver with:

$ gdbserver --multi :1234

Then, in gdb:

$ gdb
(gdb) tar ext :1234
...
(gdb) attach 5549
...
(gdb) add-inferior
(gdb) inferior 2
(gdb) attach 5549
Attaching to process 5549
Attaching to process 5549 failed


gdbserver displays the right error:

gdbserver: Cannot attach to process 5549: Operation not permitted (1), process
5549 is already traced by process 5379

but then it appears that gdb disconnects, because gdbserver prints this again:

Listening on port 1234

Then, pretty everything in the gdb session is broken.

(gdb) inferior 1
(gdb) info threads
Unknown remote qXfer reply: OK

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]