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/20039] New: Using MI/all-stop, can't interrupt multi-threaded program after continue


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

            Bug ID: 20039
           Summary: Using MI/all-stop, can't interrupt multi-threaded
                    program after continue
           Product: gdb
           Version: 7.11
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com
  Target Milestone: ---

Created attachment 9233
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9233&action=edit
Source to reproduce

This bug affects gdb 7.11, but not the current master.

In these conditions:

- all-stop
- multi-threaded inferior
- using MI

It is not possible to interrupt a program after doing a continue.  I attached a
small source file, here are the steps to reproduce:

$ gcc test.c -pthread -o test
$ ./gdb -nx -i mi test

Then, type:

- run
- ctrl-C
- continue
- ctrl-C

The last ctrl-C fails to interrupt the program.

I was a bit surprised, but bisecting found that the problem started with this
commit:

  7e0aa6aa9983c745aedc203db0cc360a0ad47cac
  List inferiors/threads/pspaces in ascending order

Since this patch does not look directly related to the problem, I suppose the
bug was already there and it only uncovered it.

The bug was later fixed in master by:

  5fe966540d6b748f825774868463003700f0c878
  Use target_terminal_ours_for_output in MI

This last patch was pushed as part of big series, but I think it's valid on its
own.  I tried cherry-picking it to the gdb-7.11-branch, and it fixes the
problem there.

-- 
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]