Summary: | devel/gdb: Incorrect thread names in core file | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Eric Badger <eric> | ||||
Component: | Individual Port(s) | Assignee: | Tijl Coosemans <tijl> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | cs, koobs, luca.pizzamiglio | ||||
Priority: | --- | Keywords: | easy, needs-qa, patch | ||||
Version: | Latest | Flags: | luca.pizzamiglio:
maintainer-feedback+
koobs: merge-quarterly? |
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
This patch works for me @Luca, setting maintainer-feedback so we know the issue is not waiting on you is great. Additionally, we do need explicit instructions on whether you 'approve' a proposed change or not, for ports you are MAINTAINER of. This can either be in the form of a comment: I approve attachment <id> Or for patches you submit, you can set the maintainer-approval flag to (+) Comment on attachment 158261 [details] Patch to avoid sysctl when inferior is a core file Approving the attachment 158261 [details] Please portrevision should be also bumped. Protip: A complete diff against the port is preferable. With regard to patch-* files in files/, please generate these using `make makepatch`. For more information see: https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html A commit references this bug: Author: tijl Date: Mon Oct 19 19:52:48 UTC 2015 New revision: 399717 URL: https://svnweb.freebsd.org/changeset/ports/399717 Log: Don't look up thread names when examining core files. The names are only available when a process is running. PR: 201291 Submitted by: Eric Badger <eric@badgerio.us> Approved by: luca.pizzamiglio@gmail.com (maintainer) Changes: head/devel/gdb/Makefile head/devel/gdb/files/fbsd-threads.c @Tijl Benefit to MFH? |
Created attachment 158261 [details] Patch to avoid sysctl when inferior is a core file If a core file has thread TIDs which overlap TIDs of running processes on the system analyzing the core file, the thread names of the currently running, local processes may be reported as names of threads in the core file. The fbsd_find_lwp_name() function in fbsd-threads.c looks up thread names by sysctl, passing in a 'pid' (actually a TID) even for core files. My first thought would be to not do this unless we're debugging a live target, but I'm not sure if this is the best way to handle this. Attached a possible patch.