catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
324 stars 78 forks source link

Only "?? ??:0" in stack trace despite addr2line being installed #1108

Open Jalle19 opened 1 year ago

Jalle19 commented 1 year ago
$ addr2line -e /usr/local/bin/minisatip 0x55b506de26a0
??:0

Is there anything special needed during compilation to make addr2line work? I got a rare crash recently and it sucks to not be able to see what actually happened.

@catalinii help?

catalinii commented 1 year ago

-ggdb should generally help. The other option is to run minisatip inside of gdb: gdb --args minisatip -f ....

Jalle19 commented 1 year ago

What do you mean by -gdbg?

catalinii commented 1 year ago

-ggdb should be in gcc arguments...this enabled debugging info for gdb

Jalle19 commented 1 year ago

Seems like tvheadend does this:

CFLAGS  += -g
ifeq ($(CONFIG_CCDEBUG),yes)
CFLAGS  += -O0
else
CFLAGS  += -O2 -D_FORTIFY_SOURCE=2
endif
catalinii commented 1 year ago

Generally is really hard to debug with anything higher than -O0

Jalle19 commented 1 year ago

Maybe we should just always build with -g -O0 on all builds then so when a crash happens we can always get a trace?

catalinii commented 1 year ago

That wht I was thinking too… but on null deference this can still happen if running minisatip outside of gdb

catalinii commented 1 year ago

There is also asan which can help with the stack traces but did not invest much time to look into that (make debug)