ballle98 / AqualinkD

Daemon to control Jandy Aqualink RS pool equipment from any home automation hub (Alexa, Homekit & Siri, Home Assistant, smartthings, domoticz etc) or web browser.
Other
6 stars 2 forks source link

Program terminated with signal SIGSEGV - invalid ctl_msg.callback at mongoose.c:3763 #20

Open ballle98 opened 5 years ago

ballle98 commented 5 years ago

see - https://github.com/sfeakes/AqualinkD/issues/52

make DBG="-g -O0"
 sudo gdb /home/pi/git/AqualinkD/release/aqualinkd /var/lib/coredumps/core-aqualinkd-sig11-user0-group0-pid13124-time1558884916

db) bt
#0  0x333a3130 in ?? ()
#1  0x000310c4 in mg_mgr_handle_ctl_sock (mgr=0xbecc5b08) at mongoose.c:3763
#2  0x000317c0 in mg_socket_if_poll (iface=0x309268, timeout_ms=0) at mongoose.c:3902
#3  0x0002e044 in mg_mgr_poll (m=0xbecc5b08, timeout_ms=0) at mongoose.c:2424
#4  0x00015a38 in main_loop () at aqualinkd.c:1304
#5  0x0001677c in daemonise (pidFile=0xbecc5b94 "/run/aqualinkd.pid", main_function=0x1548c <main_loop>) at utils.c:402
#6  0x00014d24 in main (argc=3, argv=0xbecc5e04) at aqualinkd.c:1013
(gdb) l
914         }
915         // Let's just tell everyone we set it, before we actually did.  Makes homekit happy, and it will re-correct on error.
916         _aqualink_data.swg_percent = _aqualink_data.unactioned.value;
917       }
918
919       _aqualink_data.unactioned.type = NO_ACTION;
920       _aqualink_data.unactioned.value = -1;
921       _aqualink_data.unactioned.requested = 0;
922     }
923
(gdb) up
#1  0x000310c4 in mg_mgr_handle_ctl_sock (mgr=0xbecc5b08) at mongoose.c:3763
3763          ctl_msg.callback(nc, MG_EV_POLL,
(gdb) l
3758      DBG(("read %d from ctl socket", len));
3759      (void) dummy; /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 */
3760      if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) {
3761        struct mg_connection *nc;
3762        for (nc = mg_next(mgr, NULL); nc != NULL; nc = mg_next(mgr, nc)) {
3763          ctl_msg.callback(nc, MG_EV_POLL,
3764                           ctl_msg.message MG_UD_ARG(nc->user_data));
3765        }
3766      }
3767    }
(gdb) bt
#0  0x333a3130 in ?? ()
#1  0x000310c4 in mg_mgr_handle_ctl_sock (mgr=0xbecc5b08) at mongoose.c:3763
#2  0x000317c0 in mg_socket_if_poll (iface=0x309268, timeout_ms=0) at mongoose.c:3902
#3  0x0002e044 in mg_mgr_poll (m=0xbecc5b08, timeout_ms=0) at mongoose.c:2424
#4  0x00015a38 in main_loop () at aqualinkd.c:1304
#5  0x0001677c in daemonise (pidFile=0xbecc5b94 "/run/aqualinkd.pid", main_function=0x1548c <main_loop>) at utils.c:402
#6  0x00014d24 in main (argc=3, argv=0xbecc5e04) at aqualinkd.c:1013
(gdb) p ctl_msg.callback
$1 = (mg_event_handler_t) 0x333a3132
ballle98 commented 5 years ago

was hoping this would go when mongoose.c was updated, but it is still happening. Crash seems to go away when MQTT is enabled.