theimpossibleastronaut/modemu2k

Debug builds crash on start

Closed this issue · 1 comments

  • OS: Manjaro
  • gcc: 11.1.0

If using a debug build, ./modemu2k crashes when starting

$ ./modemu2k
modemu2k 0.0.999
Enter 'at%q' to quit

Segmentation fault (core dumped)
#0  0x0000555555557a07 in flexYyInput (buf=0x55555556a9c0 "", maxsize=8192) at ../src/cmdlex.l:39
#1  0x00005555555594bd in yy_get_next_buffer () at src/cmdlex.c:1367
#2  0x000055555555900c in yylex () at src/cmdlex.c:1207
#3  0x000055555555a582 in cmdLex (p=0x5e00000001 <error: Cannot access memory at address 0x5e00000001>)
    at ../src/cmdlex.l:151
#4  0x000055555555a5e0 in atcmdInit (cmdarg=0x7fffffffe060) at ../src/atcmd.c:64
#5  0x000055555555791c in main (argc=1, argv=0x7fffffffe2a8) at ../src/modemu2k.c:748

I can't reproduce this anymore when using

gcc (GCC) 11.2.0 in a Slackware 15.0 docker container
gcc (GCC) 12.1.0 on Manjaro 21.3.6