mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
added facility to log a clue for crash handler to hint where things
got stuck/caused a crash.
This commit is contained in:
parent
d593b569c1
commit
7cc4324ac6
2
serval.h
2
serval.h
@ -861,6 +861,6 @@ extern int last_radio_temperature;
|
||||
int rhizome_active_fetch_count();
|
||||
int rhizome_active_fetch_bytes_received(int q);
|
||||
extern long long bundles_available;
|
||||
|
||||
extern char crash_handler_clue[1024];
|
||||
|
||||
#endif // __SERVALD_SERVALD_H
|
||||
|
3
server.c
3
server.c
@ -361,6 +361,7 @@ void signal_handler(int signal)
|
||||
char buf[80];
|
||||
signame(buf, sizeof(buf), signal);
|
||||
INFOF("Caught %s", buf);
|
||||
WHYF("The following clue may help: %s",crash_handler_clue);
|
||||
dump_stack();
|
||||
|
||||
switch (signal) {
|
||||
@ -378,11 +379,13 @@ void signal_handler(int signal)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
char crash_handler_clue[1024]="no clue";
|
||||
void crash_handler(int signal)
|
||||
{
|
||||
char buf[80];
|
||||
signame(buf, sizeof(buf), signal);
|
||||
WHYF("Caught %s", buf);
|
||||
WHYF("The following clue may help: %s",crash_handler_clue);
|
||||
dump_stack();
|
||||
BACKTRACE;
|
||||
if (config.server.respawn_on_crash) {
|
||||
|
4
slip.c
4
slip.c
@ -195,7 +195,9 @@ int upper7_decode(struct slip_decode_state *state,unsigned char byte)
|
||||
{
|
||||
IN()
|
||||
if (config.debug.slipdecode)
|
||||
DEBUGF("state=%d, byte=0x%02x",state->state,byte);
|
||||
snprintf(crash_handler_clue,1024,
|
||||
"upper7_decode(): state=%d, byte=0x%02x, rssi_len=%d, dst_offset=%d",
|
||||
state->state,byte,state->rssi_len,state->dst_offset);
|
||||
|
||||
// Parse out inline RSSI reports
|
||||
if (byte=='{') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user