Bug 253149 - sysutils/bsdisks occasionally crashing (signal 11 (core dumped))
Summary: sysutils/bsdisks occasionally crashing (signal 11 (core dumped))
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Gleb Popov
URL: https://bsd-hardware.info/?probe=46c9...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-01 04:43 UTC by Graham Perrin
Modified: 2021-03-20 15:46 UTC (History)
1 user (show)

See Also:
arrowd: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2021-02-01 04:43:58 UTC
For example, when making a connection from a USB extension cable (from a notebook) to the cable for a OnePlus 2 (Android handset): 

----

% tail -f -n 0 /var/log/messages
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: ugen1.8: <Android Android> at usbus1
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: umass0 on uhub8
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: umass0: <Mass Storage> on usbus1
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: cd1 at umass-sim0 bus 0 scbus6 target 0 lun 0
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: cd1: <OnePlus Device Driveret 0310> Fixed CD-ROM SCSI-2 device
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: cd1: 40.000MB/s transfers
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: cd1: 10MB (5281 2048 byte sectors)
Feb  1 04:30:58 mowa219-gjp4-8570p kernel: cd1: quirks=0x10<10_BYTE_ONLY>
Feb  1 04:30:59 mowa219-gjp4-8570p kernel: umass0: at uhub8, port 3, addr 8 (disconnected)
Feb  1 04:30:59 mowa219-gjp4-8570p kernel: cd1 at umass-sim0 bus 0 scbus6 target 0 lun 0
Feb  1 04:30:59 mowa219-gjp4-8570p kernel: cd1: <OnePlus Device Driveret 0310>  detached
Feb  1 04:30:59 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): Periph destroyed
Feb  1 04:30:59 mowa219-gjp4-8570p kernel: umass0: detached
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: umass0 on uhub8
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: umass0: <Mass Storage> on usbus1
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: cd1 at umass-sim0 bus 0 scbus6 target 0 lun 0
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: cd1: <OnePlus Device Driveret 0310> Fixed CD-ROM SCSI-2 device
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: cd1: 40.000MB/s transfers
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: cd1: 10MB (5281 2048 byte sectors)
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: cd1: quirks=0x10<10_BYTE_ONLY>
Feb  1 04:31:00 mowa219-gjp4-8570p webcamd[9078]: webcamd: Cannot find USB device
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 aa 00 0c 00 
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): SCSI status: Check Condition
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): Error 22, Unretryable error
Feb  1 04:31:00 mowa219-gjp4-8570p kernel: pid 3204 (bsdisks), jid 0, uid 0: exited on signal 11 (core dumped)
Feb  1 04:31:03 mowa219-gjp4-8570p devd[1978]: notify_clients: send() failed; dropping unresponsive client
Feb  1 04:31:03 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 aa 00 0c 00 
Feb  1 04:31:03 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
Feb  1 04:31:03 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): SCSI status: Check Condition
Feb  1 04:31:03 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
Feb  1 04:31:03 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): Error 22, Unretryable error
^C
% date ; freebsd-version -kru ; uname -v
Mon  1 Feb 2021 04:38:25 GMT
14.0-CURRENT
14.0-CURRENT
14.0-CURRENT
FreeBSD 14.0-CURRENT #84 main-53729367d3: Sat Jan 30 18:47:56 GMT 2021     root@mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
% pkg rquery '%o %v %R' automount bsdisks
sysutils/automount 1.7.2 FreeBSD
sysutils/bsdisks 0.24 FreeBSD
% sudo hw-probe -all -upload
grahamperrin's password:
Sorry, try again.
grahamperrin's password:
Sorry, try again.
grahamperrin's password:
Probe for hardware ... Ok
Reading logs ... Ok
Uploaded to DB, Thank you!

Probe URL: https://bsd-hardware.info/?probe=46c938b853
%
Comment 1 Graham Perrin 2021-02-01 04:53:33 UTC
Does the fix for bug 248531 (core dump when ejecting FAT-formatted SD card) help to think about this bug 253149?

The reason for me using an extension cable to make the connection was to minimise the risk of an interruption to physical connectivity at the base of the phone (where contacts _might_ be a little dirty, although I did jiggle the connection there – after the event – with no sign of trouble).
Comment 2 Gleb Popov freebsd_committer 2021-02-01 06:51:56 UTC
CAM errors in your log looks suspicious. Especially,

Feb  1 04:31:00 mowa219-gjp4-8570p kernel: (cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)

Are you sure that your world/kernel are in a consistent state?

Anyways, most likely bsdisks is missing a check for errno somewhere. It'd helpful if you rebuild this port with WITH_DEBUG=yes and get a backtrace for the crash.
Comment 3 Graham Perrin 2021-02-01 07:39:19 UTC
(In reply to Gleb Popov from comment #2)

> … sure that your world/kernel are in a consistent state? …

Certain; the output from freebsd-version -kru

> … rebuild this port with WITH_DEBUG=yes …

OK
Comment 4 Gleb Popov freebsd_committer 2021-02-11 05:43:19 UTC
(In reply to Graham Perrin from comment #3)
Managed to make any progress on this?

Here are detailed steps to set up for debugging:

- Compile the port WITH_DEBUG=yes, or build bsdisks from source with simple `cmake -DCMAKE_BUILD_TYPE=Debug <path_to_source> && make && make install`

- Before starting X run `gdb /usr/local/bin/bsdisks` and start the process.

- Start X and try reproduce the crash.

- Get the backtrace from the GDB.
Comment 5 Graham Perrin 2021-03-18 07:27:28 UTC
Sorry for the inactivity here, I did very little with disks recently, might do more in a few weeks.
Comment 6 Gleb Popov freebsd_committer 2021-03-18 07:31:35 UTC
(In reply to Graham Perrin from comment #5)
Make sure to use bsdisks-0.25, which contains a lot of stability fixes.
Comment 7 Graham Perrin 2021-03-20 15:46:14 UTC
(In reply to Gleb Popov from comment #6)

<https://www.freshports.org/sysutils/bsdisks/#packages> I look forward to a package for FreeBSD:14:amd64 I'm in no rush :-)