This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] PR threads/20743: Don't attempt to suspend or resume exited threads.
- From: Pedro Alves <palves at redhat dot com>
- To: John Baldwin <jhb at freebsd dot org>, vd at freebsd dot org
- Cc: Luis Machado <lgustavo at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Thu, 19 Jan 2017 11:56:28 +0000
- Subject: Re: [PATCH] PR threads/20743: Don't attempt to suspend or resume exited threads.
- Authentication-results: sourceware.org; auth=none
- References: <20161223212842.42715-1-jhb@FreeBSD.org> <email@example.com> <20161227164329.GA43600@nitro> <2893581.89CAWbS1EM@ralph.baldwin.cx>
On 12/27/2016 09:03 PM, John Baldwin wrote:
> I added the assertion for my own sanity. I suspect gdb should never try to
> invoke target_resume() with a ptid of an exited thread, but if for some
> reason it did the effect on FreeBSD would be a hang since we would suspend
> all the other threads and when the process was continued via PT_CONTINUE it
> would have nothing to do and would never return from wait(). I'd rather have
> gdb fail an assertion in that case rather than hang.
OOC, what happens on FreeBSD on the gdb.threads/no-unwaited-for-left.exp test?
- spawns a thread
- gdb switches to that thread, and,
- enables "set scheduler-locking on", and "continue"s.
- the child thread exits
- gdb should not hang.
It used to hang on Linux, until TARGET_WAITKIND_NO_RESUMED was added.