[Hamlib-developer] ATS Mini backend (44001) segfault in p_ats_update_state() with firmware 2.35
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Olav R. <ol...@ol...> - 2026-08-23 17:40:31
|
Hello,
I found a reproducible segmentation fault in the new ATS Mini
Hamlib backend (model 44001) on macOS.
Environment:
- macOS, 64-bit
- ATS Mini firmware 2.35
- Hamlib 5.0.0~git 2026-08-23
- commit 45755bebf
- /dev/cu.usbmodem14201
- 115200 baud
The ATS Mini returns monitor responses such as:
235,14074,0,0,ALL,USB,1k,3.0k,0,40,27,0,1,4.86,47
Frequency and mode control otherwise work.
When using rigctld, it can eventually crash with EXC_BAD_ACCESS.
An LLDB backtrace shows:
strtod
p_ats_update_state() at ats.c:97:38
ats_mini_get_freq() at ats.c:383:15
rig_get_freq()
rig_set_freq()
rigctl_set_freq()
rigctl_parse()
handle_socket()
The immediate fault is in strtod(), apparently while parsing a
monitor response. It looks like p_ats_update_state() can pass a
NULL/invalid token to the numeric parser if the response is
incomplete or otherwise unexpected.
I have the complete -vvvvv rigctld output and LLDB backtrace
available if useful.
This is the best part:
* thread #3, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: ... libsystem_c.dylib`fastParse64
frame #1: ... `_ffpp_strtoencf64_l`
frame #2: ... `strtod`
frame #3: ... libhamlib.5.dylib`p_ats_update_state(rig=...) at ats.c:97:38
frame #4: ... `ats_mini_get_freq(...)` at ats.c:383:15
frame #5: ... `rig_get_freq(...)` at rig.c:2687:19
frame #6: ... `rig_set_freq(...)` at rig.c:2452:23
frame #7: ... `rigctld` ... `rigctl_set_freq(...)`
frame #8: ... `rigctld` ... `rigctl_parse(...)`
frame #9: ... `rigctld` ... `handle_socket(...)`
vy 73,
Olav
DG3BP
|