uweseimet / scsi2pi

Advanced performant SCSI/SASI emulation and tools for the PiSCSI/RaSCSI board
https://www.scsi2pi.net
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

s2pctl crashes with segmentation fault in interactive mode when "enter" key is pressed without any other input #36

Closed fdanapfel closed 10 months ago

fdanapfel commented 10 months ago

When creating a new ticket please provide information on your environment.

Describe the issue

When running s2pctl in interactive mode and just pressing enter without entering anything else it crashes with a "Segmentation fault":

$ /opt/scsi2pi/bin/s2pctl 
SCSI Target Emulator and SCSI Tools SCSI2Pi (Server Controller Tool)
Version 1.2-devel
Copyright (C) 2016-2020 GIMONS
Copyright (C) 2020-2023 Contributors to the PiSCSI project
Copyright (C) 2021-2024 Uwe Seimet
Entering interactive mode, Ctrl-D or "exit" to quit
s2pctl>
Segmentation fault

When entering commands it works without issues:

$ /opt/scsi2pi/bin/s2pctl 
SCSI Target Emulator and SCSI Tools SCSI2Pi (Server Controller Tool)
Version 1.2-devel
Copyright (C) 2016-2020 GIMONS
Copyright (C) 2020-2023 Contributors to the PiSCSI project
Copyright (C) 2021-2024 Uwe Seimet
Entering interactive mode, Ctrl-D or "exit" to quit
s2pctl>server-version
Device server version: SCSI2Pi 1.2-devel
s2pctl>
uweseimet commented 10 months ago

@fdanapfel Indeed ;-). For the sake of simplicity I will fix that while working on https://github.com/uweseimet/scsi2pi/issues/37.

uweseimet commented 10 months ago

@fdanapfel The new issue_37 branch should fix this issue. Can you please test? I case you can't, e.g. because you only install binary packages, it's fine, of course. There is still more time for testing, e.g. with an upcoming binary package.

fdanapfel commented 10 months ago

@uweseimet I prefer to use the binary packages, and since this is not a major issue I'm happy to wait until the fix is included in a binary package to test if the issue is fixed.

uweseimet commented 10 months ago

@fdanapfel Development builds with this issue fixed are now available for download.

fdanapfel commented 10 months ago

@uweseimet Thanks, I can confirm that with scsi2pi_1.2_devel_a1a8ada_bookworm_arm64-1.deb the issue no longer occurs:

$ sudo apt install ./scsi2pi_1.2_devel_a1a8ada_bookworm_arm64-1.deb
...
/opt/scsi2pi/bin $ ./s2pctl 
SCSI Target Emulator and SCSI Tools SCSI2Pi (Server Controller Tool)
Version 1.2-devel
Copyright (C) 2016-2020 GIMONS
Copyright (C) 2020-2023 Contributors to the PiSCSI project
Copyright (C) 2021-2024 Uwe Seimet
Entering interactive mode, Ctrl-D or "exit" to quit
s2pctl>
s2pctl>
s2pctl>
s2pctl>server-version
Device server version: SCSI2Pi 1.2-devel
s2pctl>