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/19494] hang killing unfollowed fork children


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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a2077e254098828614ef6621cf8df28185e711d0

commit a2077e254098828614ef6621cf8df28185e711d0
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jan 25 12:00:20 2016 +0000

    Fix PR 19461: strange "info thread" behavior in non-stop

    If you have "set follow-fork child" set, then if you do "info threads"
    right after a fork, and before the child reports any other event to
    GDB core, you'll see:

    (gdb) info threads
      Id   Target Id         Frame
    * 1.1  Thread 0x7ffff7fc1740 (LWP 31875) "fork-plus-threa" (running)
      2.1  process 31879 "fork-plus-threa" Selected thread is running.
    (gdb)

    The "Selected thread is running." bit is a bogus error.  That was GDB
    trying to fetch the current frame of thread 2.1, because the external
    runnning state is "stopped", and then throwing an error because the
    thread is actually running.

    This actually affects all-stop + schedule-multiple as well.

    The problem here is that on a fork event, GDB doesn't update the
    external parent/child running states.

    New comprehensive test included.  The "kill inferior 1" / "kill
    inferior 2" bits also trip on PR gdb/19494 (hang killing unfollowed
    fork children), which was fixed by the previous patch.

    gdb/ChangeLog:
    2016-01-25  Pedro Alves  <palves@redhat.com>

        PR threads/19461
        * infrun.c (handle_inferior_event_1) <fork/vfork>: Update
        parent/child running states.

    gdb/testsuite/ChangeLog:
    2016-01-25  Pedro Alves  <palves@redhat.com>

        PR threads/19461
        * gdb.base/fork-running-state.c: New file.
        * gdb.base/fork-running-state.exp: New file.

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