Bug 193335 - crashinfo(8) fails to find kernel with devel/gdb in PATH
Summary: crashinfo(8) fails to find kernel with devel/gdb in PATH
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-05 03:14 UTC by Jan Beich
Modified: 2016-08-03 17:26 UTC (History)
2 users (show)

See Also:
jhb: mfc-stable11+
jhb: mfc-stable10+
jhb: mfc-stable9+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2014-09-05 03:14:04 UTC
1/ install devel/gdb with GDB_LINK (default)
2/ prefer /usr/local apps in PATH

$ PATH=/usr/local/bin:$PATH crashinfo
Unable to find matching kernel for /var/crash/vmcore.1

$ echo 'printf "  Version String: %s", version' | /usr/local/bin/gdb -x /dev/stdin -batch /boot/kernel/kernel
warning: /dev/stdin: No such file or directory
Comment 1 John Baldwin freebsd_committer freebsd_triage 2016-06-25 23:28:41 UTC
I'm working on fixing crashinfo to use devel/gdb when it is available.
Comment 2 John Baldwin freebsd_committer freebsd_triage 2016-07-15 20:40:33 UTC
Patch posted at https://reviews.freebsd.org/D7218
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-07-20 18:42:32 UTC
A commit references this bug:

Author: jhb
Date: Wed Jul 20 18:41:47 UTC 2016
New revision: 303109
URL: https://svnweb.freebsd.org/changeset/base/303109

Log:
  Update crashinfo to work with newer gdb from ports.

  If gdb from ports is installed, use it instead of the base system gdb
  to extract variables from a kernel.  Note that base gdb and ports gdb
  do not support the same options for invoking a single command in batch
  mode, so a wrapper shell function is used.  In addition, prefer kgdb
  from ports when generating a backtrace if present.

  PR:		193335
  Reviewed by:	emaste
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D7218

Changes:
  head/usr.sbin/crashinfo/crashinfo.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-07-27 17:55:52 UTC
A commit references this bug:

Author: jhb
Date: Wed Jul 27 17:55:14 UTC 2016
New revision: 303402
URL: https://svnweb.freebsd.org/changeset/base/303402

Log:
  MFC 303109: Update crashinfo to work with newer gdb from ports.

  If gdb from ports is installed, use it instead of the base system gdb
  to extract variables from a kernel.  Note that base gdb and ports gdb
  do not support the same options for invoking a single command in batch
  mode, so a wrapper shell function is used.  In addition, prefer kgdb
  from ports when generating a backtrace if present.

  PR:		193335
  Approved by:	re (gjb)

Changes:
_U  stable/11/
  stable/11/usr.sbin/crashinfo/crashinfo.sh
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-07-27 17:55:53 UTC
A commit references this bug:

Author: jhb
Date: Wed Jul 27 17:55:40 UTC 2016
New revision: 303403
URL: https://svnweb.freebsd.org/changeset/base/303403

Log:
  MFC 303109: Update crashinfo to work with newer gdb from ports.

  If gdb from ports is installed, use it instead of the base system gdb
  to extract variables from a kernel.  Note that base gdb and ports gdb
  do not support the same options for invoking a single command in batch
  mode, so a wrapper shell function is used.  In addition, prefer kgdb
  from ports when generating a backtrace if present.

  PR:		193335

Changes:
_U  stable/10/
  stable/10/usr.sbin/crashinfo/crashinfo.sh
_U  stable/9/usr.sbin/crashinfo/
  stable/9/usr.sbin/crashinfo/crashinfo.sh