[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#850841: gcc-6: [kfreebsd] guality tests hang on kfreebsd



Maybe it's an error on FreeBSD to try to ptrace your own parent process.
From https://www.freebsd.org/cgi/man.cgi?query=ptrace:

| For the duration of the tracing session, the traced process will be
| ``re-parented'', with its parent process ID (and resulting behavior)
| changed to the tracing process.

gdb seems fine attaching to other pids than its parent process.
But this simple testcase of attaching to the parent process, shows the
same issue as the guality tests:

$ cat attach-self.sh 
#!/bin/sh -e
echo "attach $$" | gdb -nx -nw

| GNU gdb (Debian 7.12-4) 7.12
| Copyright (C) 2016 Free Software Foundation, Inc.
| License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
| and "show warranty" for details.
| This GDB was configured as "x86_64-kfreebsd-gnu".
| Type "show configuration" for configuration details.
| For bug reporting instructions, please see:
| <http://www.gnu.org/software/gdb/bugs/>.
| Find the GDB manual and other documentation resources online at:
| <http://www.gnu.org/software/gdb/documentation/>.
| For help, type "help".
| Type "apropos word" to search for commands related to "word".
| (gdb) Attaching to process 95320
| Couldn't get registers: Device or resource busy.
| Couldn't get registers: Device or resource busy.
| (gdb) quit
| A debugging session is active.
| 
|         Inferior 1 [process 95320] will be detached.
| 
| Quit anyway? (y or n) [answered Y; input not from terminal]
| Detaching from program: , process 95320
| ptrace: Device or resource busy.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org

Attachment: signature.asc
Description: Digital signature


Reply to: