Created attachment 208771 [details] 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.
A commit references this bug: Author: arrowd Date: Sat Nov 2 06:25:28 UTC 2019 New revision: 516288 URL: https://svnweb.freebsd.org/changeset/ports/516288 Log: sysutils/bsdisks: Add a patch to handle NVMe drives properly. PR: 241645 Submitted by: cmt Changes: head/sysutils/bsdisks/Makefile head/sysutils/bsdisks/files/ head/sysutils/bsdisks/files/patch-camcontrol.c
Committed, thanks.
Looks like the patch was lost during update to 0.10 and patch had not been upstreamed - so the bug is here again after update.
cam_get_device() works ok for nvme devices, but cam_open_spec_device() fails.
A commit references this bug: Author: arrowd Date: Wed Dec 11 12:36:09 UTC 2019 New revision: 519798 URL: https://svnweb.freebsd.org/changeset/ports/519798 Log: sysutils/bsdisks: Update to 0.11. PR: 241645 Changes: head/sysutils/bsdisks/Makefile head/sysutils/bsdisks/distinfo
(In reply to Oleg Sidorkin from comment #3) Silly me, I just applied that patch on wrong line.