Created attachment 161857 [details] test case I am attaching the test case. To reproduce the problem, please do this: Compile: > cc -pthread -o test-system test-system.c Run: > gdb ./test-system > (gdb) r > Starting program: ./test-system > [New process 62745] > [New Thread 801406400 (LWP 100922)] > 0x0000000800b00a2d in vfork () from /lib/libc.so.7 > fbsd_thread_resume: no thread to satisfy query > (gdb) The error messages are the problem. This only happens with gdb-7.10 and not with gdb-7.9.1. Problem disappears without -pthread option. FreeBSD xxx.xxx.com 10.2-STABLE FreeBSD 10.2-STABLE #0 r288058M: Mon Sep 21 03:10:37 PDT 2015 xxx@xxx.com:/usr/obj/usr/src/sys/GENERIC amd64
Created attachment 161858 [details] test case
Created attachment 162124 [details] Fixing patch This patch should solve the problem. Please run some test with it applied, if you can.
The test case now passes. Thank you for fixing it, Luca!
A commit references this bug: Author: tijl Date: Sun Oct 18 17:31:17 UTC 2015 New revision: 399623 URL: https://svnweb.freebsd.org/changeset/ports/399623 Log: Fix a regression when debugging a threaded process that forks. PR: 203661 Submitted by: luca.pizzamiglio@gmail.com (maintainer) Changes: head/devel/gdb/Makefile head/devel/gdb/files/fbsd-threads.c
*** Bug 203770 has been marked as a duplicate of this bug. ***
For whatever reason I see the same problem again with the current gdb. I am not sure how is this possible that this test passed when you asked me to test it on 2015-10-16. But now I have exactly the same symptom again.
Hi Yuri, unfortunately, I'm not able to reproduce the error anymore... please, re-check that your devel/gdb/file/fbsd-thread.c has the patch attached in this bug report. Could you also provide the output of make showconfig?
HI Luca, I verified that all patches are in sync with subversion repository, rebuilt gdb, and still see this problem. OS version: 10.2-STABLE #0 r290123: Wed Oct 28 17:59:42 PDT 2015 amd64
Possibly not the same bug, but the same error message. Linking with pthreads and openmp. Using popen(), gdb emits this error during the call to popen(). If I then 'q'uit gdb, the program is detached and runs to completion. I am unable to 'c'ontinue execution in the debugger. I'm up to date with the patches, 10.1-RELEASE, compiled with g++48. /usr/ports/devel/gdb# make showconfig ===> The following configuration options are available for gdb-7.10_3: DEBUG=off: Build with debugging support EXPAT=off: XML parser support via Expat GDB_LINK=on: Create /usr/local/bin/gdb symlink GUILE=off: Guile extension language support KGDB=on: Kernel Debugging Support PYTHON=off: Python bindings or support THREADS=on: Threading support TUI=on: Text User Interface enabled ====> Command line editing via libreadline: you have to select exactly one of them BASE_READLINE=off: from base system (experimental) BUNDLED_READLINE=off: from gdb distfile PORT_READLINE=on: from devel/readline port
Created attachment 162807 [details] Fixing that bug and a potential build issue I've build a test case with popen() and then I was able to reproduce the error. This patch should fix the problem. Moreover, this patch fix a potential parallel build issue.
A commit references this bug: Author: tijl Date: Thu Nov 5 18:48:47 UTC 2015 New revision: 400860 URL: https://svnweb.freebsd.org/changeset/ports/400860 Log: - Fix a potential parallel build issue - Fix a regression when debugging a threaded process that forks (like r399623, but for vfork(2)) PR: 203661 Submitted by: luca.pizzamiglio@gmail.com (maintainer) Changes: head/devel/gdb/Makefile head/devel/gdb/files/extrapatch-kgdb head/devel/gdb/files/fbsd-threads.c