drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
193 stars 49 forks source link

Rapid double click on modem Stop button crashes freedv-gui #397

Closed Tyrbiter closed 1 year ago

Tyrbiter commented 1 year ago

I accidentally managed to crash the program when I mistakenly double-clicked the modem stop button.

Probably not very important but I thought I would mention it in case there is an easy lock or mutex that could be added to prevent an errant click reaching the gui code.

This is the development version 1.8.10-devel with a few local changes to add in recent PRs but I don't think it has changed any of the main logic, it's mostly cosmetic size changes.

I didn't manage to capture any debug, sorry.

tmiw commented 1 year ago

I was only briefly able to test here and it doesn't look like I can duplicate. Granted, I don't have a radio configured right now (still traveling).

How reproducible is it for you?

Tyrbiter commented 1 year ago

Well, I have just managed to provoke it again, but I didn't manage to capture debug, I will have another go.

The problem occurs when the button is still showing Stop, sometimes my system takes a short time for it to show Start again. If the second click is received before Start shows then the window disappears as the crash happens.

I currently have a mouse that is not always behaving properly, missing clicks and sometimes sending a left click as a right click, I am awaiting a replacement. If this continues when I have the new mouse I will capture some proper debug.

Tyrbiter commented 1 year ago

OK, I see a segfault, but the debug may not be very helpful, it starts when the Stop button causes a rig close to be sent:

ser_close: restoring options rig_close(1585): 0x563ebdd7df3c rs->comm_state==0?=0 1:rig.c(1589):rig_close returning(0) 1:kenwood.c(853):kenwood_cleanup entered 1:kenwood.c(858):kenwood_cleanup returning(0) [2023-05-21 13:31:14] [disconnect] Disconnect close local:[1000,End by user] remote:[1000] Setting callsign to G8SEZ PulseAudioDevice[Sun May 21 13:31:14 2023]: connecting to record device alsa_input.usb-CMEDIA_Q9-1-00.pro-input-0 PulseAudioDevice[Sun May 21 13:31:14 2023]: connecting to playback device alsa_output.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo PulseAudioDevice[Sun May 21 13:31:14 2023]: connecting to record device alsa_input.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo PulseAudioDevice[Sun May 21 13:31:14 2023]: connecting to playback device alsa_output.usb-Generic_Realtek_USB2.0_Audio-00.analog-stereo rig_init: rig_model=Kenwood TS-890S 20230517.11 rig_init: rig has VFO_A rig_init: rig has VFO_B kenwood_init called, version 20230517/20230517.11 kenwood.c(848):kenwood_init returning2(0) rig_token_lookup called for rig_pathname rig_confparam_lookup called for rig_pathname rig_set_conf called rig_confparam_lookup called for 1073741834 rig_set_conf: rig_pathname='/dev/ttyUSB1' rig_token_lookup called for serial_speed rig_confparam_lookup called for serial_speed rig_set_conf called rig_confparam_lookup called for 1073741844 rig_set_conf: serial_speed='115200' rig.c(835):rig_open entered rig_settings_load_all: settings_file (/home/bdm/.config/hamlib_settings): No such file or directory rig_open: cwd=/home/bdm rig_open: /home/bdm/hamlib_settings does not exist serial_open: /dev/ttyUSB1 tcflush 1:rig.c(7637):async_data_handler_start entered 1:rig.c(7644):async_data_handler_start returning(0) rig.c(262):add_opened_rig returning2(0) rig_open: 0x563ebdd1cadc rs->comm_state==1?=1 1:rig.c(6198):rig_get_powerstat entered 2:kenwood.c(5114):kenwood_get_powerstat entered kenwood_safe_transaction called, cmd=PS, expected=3 kenwood_transaction called cmd=PS datasize=6 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 2:kenwood.c(5147):kenwood_get_powerstat returning(0) 1:rig.c(6232):rig_get_powerstat returning(0) 1:kenwood.c(870):kenwood_open entered 2:kenwood.c(1147):kenwood_get_id entered kenwood_transaction called cmd=ID datasize=128 tcflush kenwood.c(670):kenwood_transaction returning2(0) 2:kenwood.c(1154):kenwood_get_id returning(0) 2:rig.c(6198):rig_get_powerstat entered 3:kenwood.c(5114):kenwood_get_powerstat entered kenwood_safe_transaction called, cmd=PS, expected=3 kenwood_transaction called cmd=PS datasize=6 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 3:kenwood.c(5147):kenwood_get_powerstat returning(0) 2:rig.c(6232):rig_get_powerstat returning(0) 2:rig.c(3001):rig_get_vfo entered 3:kenwood.c(1793):kenwood_get_vfo_if entered 4:kenwood.c(1167):kenwood_get_if entered kenwood_safe_transaction called, cmd=IF, expected=37 kenwood_transaction called cmd=IF datasize=128 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 4:kenwood.c(1169):kenwood_get_if returning(0) kenwood_get_vfo_if: priv->tx_vfo=VFOA 3:kenwood.c(1841):kenwood_get_vfo_if returning(0) 2:rig.c(3066):rig_get_vfo returning(0) kenwood_open: found the right driver for TS-890S(2041) 2:kenwood.c(5008):kenwood_get_trn entered kenwood_safe_transaction called, cmd=AI, expected=3 kenwood_transaction called cmd=AI datasize=6 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 2:kenwood.c(5045):kenwood_get_trn returning(0) 2:kenwood.c(1655):kenwood_get_split_vfo_if entered 3:kenwood.c(1167):kenwood_get_if entered kenwood_safe_transaction called, cmd=IF, expected=37 kenwood_transaction called cmd=IF datasize=128 kenwood.c(279):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 3:kenwood.c(1169):kenwood_get_if returning(0) kenwood_get_split_vfo_if: priv->tx_vfo=VFOA, split=0 2:kenwood.c(1776):kenwood_get_split_vfo_if returning(0) kenwood_open: priv->tx_vfo=VFOA 1:kenwood.c(1089):kenwood_open returning(0) 1:rig.c(3001):rig_get_vfo entered 1:rig.c(3036):rig_get_vfo returning(0) 1:rig.c(2056):rig_get_freq entered rig_get_freq(2071) called vfo=VFOA rig.c(2080) vfo=VFOA, curr_vfo=VFOA rig_get_freq(2183): vfo_opt=0, model=2041 2:kenwood.c(2006):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FA, expected=13 kenwood_transaction called cmd=FA datasize=50 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 2:kenwood.c(2076):kenwood_get_freq returning(0) 1:rig.c(2291):rig_get_freq returning(0) 1:rig.c(2056):rig_get_freq entered rig_get_freq(2071) called vfo=VFOB rig.c(2080) vfo=VFOB, curr_vfo=VFOA rig_get_freq(2183): vfo_opt=0, model=2041 2:kenwood.c(2006):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FB, expected=13 kenwood_transaction called cmd=FB datasize=50 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 2:kenwood.c(2076):kenwood_get_freq returning(0) 1:rig.c(2291):rig_get_freq returning(0) 1:rig.c(5238):rig_get_split_vfo entered 2:kenwood.c(1655):kenwood_get_split_vfo_if entered 3:kenwood.c(1167):kenwood_get_if entered kenwood_safe_transaction called, cmd=IF, expected=37 kenwood_transaction called cmd=IF datasize=128 kenwood.c(279):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) 3:kenwood.c(1169):kenwood_get_if returning(0) kenwood_get_split_vfo_if: priv->tx_vfo=VFOA, split=0 2:kenwood.c(1776):kenwood_get_split_vfo_if returning(0) 1:rig.c(5303):rig_get_split_vfo returning(0) rig_open(1405): Current split=0, tx_vfo=VFOA 1:rig.c(2519):rig_get_mode entered kenwood_get_mode called, curr_vfo=VFOA kenwood_safe_transaction called, cmd=MD, expected=3 kenwood_transaction called cmd=MD datasize=6 tcflush kenwood.c(670):kenwood_transaction returning2(0) kenwood.c(741):kenwood_safe_transaction returning2(0) kenwood2rmode called 2:rig.c(2677):rig_passband_normal entered 2:rig_passband_normal: return filter#0, width=2400 2:rig.c(2698):rig_passband_normal returning(2400) kenwood.c(2797):kenwood_get_mode returning2(0) 2:cache.c(36):rig_set_cache_mode entered 2:cache.c(119):rig_set_cache_mode returning(0) 1:rig.c(2656):rig_get_mode returning(0) rig.c(1429):rig_open returning2(0) 1:rig.c(2056):rig_get_freq entered rig_get_freq(2071) called vfo=VFOB rig.c(2080) vfo=VFOB, curr_vfo=VFOA 1:rig.c(2163):rig_get_freq returning(0) 1:rig.c(3001):rig_get_vfo entered 1:rig.c(3036):rig_get_vfo returning(0) 1:rig.c(2519):rig_get_mode entered 1:rig.c(2577):rig_get_mode returning(0) 1:rig.c(2056):rig_get_freq entered rig_get_freq(2071) called vfo=VFOA rig.c(2080) vfo=VFOA, curr_vfo=VFOA 1:rig.c(2163):rig_get_freq returning(0) Segmentation fault (core dumped)

ghost commented 1 year ago

Double click Stop button crashes in Debian Linux 12.

On 5/21/23 00:46, Mooneer Salem wrote:

I was only briefly able to test here and it doesn't look like I can duplicate. Granted, I don't have a radio configured right now (still traveling).

How reproducible is it for you?

— Reply to this email directly, view it on GitHub https://github.com/drowe67/freedv-gui/issues/397#issuecomment-1556081972, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDJSRGXVMZY6KUOITYKBDXHGM3ZANCNFSM6AAAAAAYIYA7NI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tmiw commented 1 year ago

Yeah, this sounds like I'm going to need to have an actual radio plugged in to reproduce this. Will work on it once I'm done traveling. Thanks all for confirming!

tmiw commented 1 year ago

Unfortunately I haven't been able to duplicate this at home so far, but I created PR #399 to ensure that the buttons remain disabled during startup and shutdown. This should allow wxWidgets to block inadvertent clicks until we're sure we can safely perform the other action. As a side effect, the UI no longer appears locked up during start and stop.