[Bug 241645] sysutils/bsdisks: coredumps when encountering nvme devices

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Nov 1 16:39:23 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241645

            Bug ID: 241645
           Summary: sysutils/bsdisks: coredumps when encountering nvme
                    devices
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: easy, patch, patch-ready
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: arrowd at FreeBSD.org
          Reporter: cmt at freebsd.org
          Assignee: arrowd at FreeBSD.org
             Flags: maintainer-feedback?(arrowd at FreeBSD.org)

Created attachment 208771
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=208771&action=edit
return error if cam_open_spec_device() fails

bsdisks opens devices with cam_open_spec_device() - "opens the pass(4) device
that correspinds to the device name ..." as per the man page. nvme disks (nvd*)
do not have a pass device as per "camcontrol devlist" on my system.
cam_open_spec_device() returns NULL in that case, which triggers an error
message but is then passed on to other functions, until bsdisks crashes in
camlib; backtrace is:

(gdb) bt
#0  cam_getccb (dev=0x0) at /usr/src/lib/libcam/camlib.c:85
#1  0x00000000002622ec in scsiinquiry (device=0x0, task_attr=32,
    retry_count=1, timeout=0, result=0x7fffdf9fadcc)
    at /wrkdirs/usr/ports/sysutils/bsdisks/work/bsdisks-0.9/camcontrol.c:596
#2  0x00000000002621ec in cam_is_removable (device_path=0x80191f818 "nvd0")
    at /wrkdirs/usr/ports/sysutils/bsdisks/work/bsdisks-0.9/camcontrol.c:177
#3  0x000000000025932f in CamControlProber::run (this=0x80186eb10)
    at
/wrkdirs/usr/ports/sysutils/bsdisks/work/bsdisks-0.9/camcontrolprober.cpp:40
#4  0x0000000800671ffd in ?? () from /usr/local/lib/qt5/libQt5Core.so.5
#5  0x000000080066d4a4 in ?? () from /usr/local/lib/qt5/libQt5Core.so.5
#6  0x0000000800e76776 in thread_start (curthread=0x801854400)
    at /usr/src/lib/libthr/thread/thr_create.c:292
#7  0x0000000000000000 in ?? ()

Attached patch (to be dropped into files/ - bump PORTREVISION!) catches that
NULL and returns an error, thus making bsdisks survive.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list