Re: [Hamlib-developer] Spid rotator crash
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: G0GJV <g0...@go...> - 2024-08-16 08:42:29
|
Except in spid_rot_init if (rot->caps->rot_model == ROT_MODEL_SPID_ROT2PROG || rot->caps->rot_model == ROT_MODEL_SPID_MD01_ROT2PROG) { struct spid_rot2prog_priv_data *priv; priv = (struct spid_rot2prog_priv_data *)calloc(1, sizeof(struct spid_rot2prog_priv_data)); i.e. if NOT Rot2Prog, the priv data is never allocated. Thanks for adding the patch. Mike G0GJV > priv should never be null unless you are calling these functions directly > instead of going through the API. > But I added the patch anyways. > Mike W9MDB > > > > On Thursday, August 15, 2024 at 12:58:54 PM CDT, G0GJV <g0...@go...> > wrote: > > I've found that very recently my rotator control code is crashing when > I tell a Spid Rot1Prog controller to "stop". > > Building a debug version of Hamlib on a Mac has isolated this to line > 538 of spid.c > > priv->dir = 0; > > This is because "priv" is only going to be valid for a Rot2Prog (az/el) > controller' > > My "simple" (and working) fix is just > > Â Â if (priv) > Â Â { > Â Â Â Â priv->dir = 0; > Â Â } > Â Â > I think this is the only place this mistake has been made; I'd offer a > patch, but I'm not confident without some background as to why this > code was fairly recently added. > > Mike G0GJV |