Bug 218555 - devel/gdb: Fails to debug qtox: ptrace: No such process.
Summary: devel/gdb: Fails to debug qtox: ptrace: No such process.
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Luca Pizzamiglio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-10 22:45 UTC by Yuri Victorovich
Modified: 2018-11-13 21:31 UTC (History)
1 user (show)

See Also:
luca.pizzamiglio: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2017-04-10 22:45:09 UTC
I build qTox with debug info (CONFIG += debug). It fails, see log below.

gdb-7.12.1

(gdb) r -p yuri-other
Starting program: /usr/home/yuri/github/qTox/qtox -p yuri-other
[New LWP 100300 of process 5489]
[New LWP 100304 of process 5489]
[New LWP 100332 of process 5489]
[22:33:33.987 UTC] persistence/settings.cpp:133 : Debug: "Loading settings from /home/yuri/.config/tox/qtox.ini"
[22:33:34.016 UTC] ipc.cpp:60 : Debug: Our global IPC ID is  15074530339528586024
[22:33:34.017 UTC] ipc.cpp:72 : Debug: Attaching to the global shared memory
[22:33:34.017 UTC] main.cpp:215 : Debug: built on:  15:12:20 Apr 10 2017 ( 1491862323 )
[22:33:34.018 UTC] main.cpp:216 : Debug: commit:  0f54e442627e4882634e52c57e20f55b9454af48

[22:33:34.018 UTC] ipc.cpp:133 : Debug: postEvent  "activate" to 3395321266
[22:33:35.957 UTC] main.cpp:269 : Debug: Event "activate" was handled by other client.
[LWP 100300 of process 5489 exited]
[LWP 100304 of process 5489 exited]
r_debug_state (rd=0x801a06f78, m=0x80192edf0) at /usr/src/libexec/rtld-elf/rtld.c:3807
ptrace: No such process.
(gdb)
Comment 1 luca.pizzamiglio 2017-04-18 12:07:30 UTC
Hi Yuri,

this bug seems similar to this one https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212607

The problem should be in FreeBSD, not in gdb. Which FreeBSD version are you using?

The solution has been committed in 10-STABLE and 11-STABLE (r313992), but no releases has it currently.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2017-04-18 13:47:15 UTC
I use 11-STABLE r308114.
Comment 3 luca.pizzamiglio 2017-04-18 16:29:06 UTC
can you please update your 11-STABLE at least at r315949 ?

This revision contains the fixed to ptracestop() that should solve your issue.
(as reference: https://svnweb.freebsd.org/base?view=revision&revision=315949)

as also jhb pointed out, solving this problem in gdb was quite difficult, so the solution is to update FreeBSD.
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2017-07-10 07:59:19 UTC
(In reply to luca.pizzamiglio from comment #3)

Luca,

Running gdb-7.12.1_2 on r320820 also has this problem. For qTox it now happens in the end of the run:
> [LWP 102278 of process 83497 exited][07:53:45.085 UTC] persistence/settings.cpp:453 : Debug: "Saving global settings at /home/yuri/.config/tox/qtox.ini"
> [LWP 102435 of process 83497 exited]
> [LWP 100535 of process 83497 exited][07:53:45.088 UTC] main.cpp:61 : Debug: Cleanup success
> [07:53:45.088 UTC] main.cpp:321 : Debug: Exit with status 0
> [LWP 102273 of process 83497 exited]
> [LWP 100218 of process 83497 exited]
> [LWP 102277 of process 83497 exited]
> r_debug_state (rd=0x80193b360, m=0x7fffffffe220) at /usr/src/libexec/rtld-elf/rtld.c:3918
> ptrace: No such process.

But for some other processes this happens in the middle. It seems to be triggered by exiting threads.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2017-07-10 08:36:33 UTC
gdb-7.9.1 is free of this problem. So this is a regression.
Comment 6 Tobias Kortkamp freebsd_committer freebsd_triage 2018-08-21 16:43:15 UTC
Assign to maintainer.

Is this still relevant?
Comment 7 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-11-13 20:12:53 UTC
I'm not able to reproduce this error. May I close it?
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2018-11-13 21:31:07 UTC
Sure!