• coredump in term when modem went haywire

    From Nigel Reed@1:103/705 to GitLab issue in main/sbbs on Thu Apr 6 23:41:46 2023
    open https://gitlab.synchro.net/main/sbbs/-/issues/545

    Tried to do a dialin test and the modems did not negotiate problem which caused a lot of line noise to the terminal, eventually causing a segfault. <code>bbs@bbs:/tmp$ gdb ~/sbbs-git/src/sbbs3/gcc.linux.x64.exe.debug/sbbs 'core.sbbs!termNode.713'GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2Copyright (C) 2020 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.Type "show copying" and "show warranty" for details.This GDB was configured as "x86_64-linux-gnu".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word"...Reading symbols from /home/bbs/sbbs-git/src/sbbs3/gcc.linux.x64.exe.debug/sbbs...[New LWP 83850][New LWP 739][New LWP 718][New LWP 715][New LWP 716][New LWP 719][New LWP 758][New LWP 717][New LWP 714][New LWP 745][New LWP 756][New LWP 760][New LWP 77288][New LWP 77100][New LWP 748][New LWP 55065][New LWP 68313][New LWP 23832][New LWP 749][New LWP 68303][New LWP 12279][New LWP 62614][New LWP 750][New LWP 23833][New LWP 23813][New LWP 3781][New LWP 757][New LWP 3780][New LWP 44568][New LWP 759][New LWP 3271][New LWP 3268][New LWP 72649][New LWP 762][New LWP 763][New LWP 12278][New LWP 62615][New LWP 743][New LWP 761][New LWP 3267][New LWP 55049][New LWP 44564][New LWP 12359][New LWP 83971][New LWP 70499][New LWP 83997][New LWP 62617][New LWP 53834][New LWP 52974][New LWP 68312][New LWP 12360][New LWP 70498][New LWP 70446][New LWP 55064][New LWP 72567][New LWP 62613][New LWP 72650][New LWP 53832][New LWP 77287][New LWP 53831][New LWP 62616][New LWP 83996][New LWP 62618][New LWP 52975][New LWP 16500][New LWP 62620][New LWP 44567][New LWP 62621][New LWP 52973][New LWP 62619][New LWP 713][Thread debugging using libthread_db enabled]Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".--Type <RET> for more, q to quit, c to continue without paging--Core was generated by `/sbbs/exec/sbbs d'.Program terminated with signal SIGSEGV, Segmentation fault.#0 0x00007f97959d921a in sbbs_t::~sbbs_t (this=0x7f977f7be660, __in_chrg=<optimized out>) at main.cpp:36903690 FREE_AND_NULL(usrsub[i]); /* exception here (ptr=0xfdfdfdfd) on exit July-10-2002 */[Current thread is 1 (Thread 0x7f96c63fc700 (LWP 83850))](gdb) bt#0 0x00007f97959d921a in sbbs_t::~sbbs_t (this=0x7f977f7be660, __in_chrg=<optimized out>) at main.cpp:3690#1 0x00007f97959dc47c in node_thread (arg=0x7f977f7be660) at main.cpp:4379#2 0x00007f97956be609 in start_thread (arg=<optimized out>) at pthread_create.c:477#3 0x00007f97955e3133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95(gdb) bt full#0 0x00007f97959d921a in sbbs_t::~sbbs_t (this=0x7f977f7be660, __in_chrg=<optimized out>) at main.cpp:3690 i = 0 i = <optimized out> sleep_msecs = <optimized out> ts = <optimized out> sleep_msecs = <optimized out> ts = <optimized out>#1 0x00007f97959dc47c in node_thread (arg=0x7f977f7be660) at main.cpp:4379 str = "/sbbs/node2/client.ini", '\000' <repeats 290 times>... file = 0 curshell = -1 node = {status = 0 '\000', errors = 0 '\000', action = 0 '\000', useron = 0, connection = 65535, misc = 0, aux = 0, extaux = 0} login_attempts = 0 sbbs = 0x7f977f7be660 login_success = false __FUNCTION__ = "node_thread" now = 1680849310 fp = 0x7f978cf98fb0#2 0x00007f97956be609 in start_thread (arg=<optimized out>) at pthread_create.c:477 ret = <optimized out> pd = <optimized out> unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140285547890432, -325832749134411976, 140288969622510, 140288969622511, 140288969622688, 140285547888448, 312970110248126264, 312228319099979576}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = 0#3 0x00007f97955e3133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95No locals.</code>
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Apr 8 16:29:40 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/545#note_3448

    The output of 'print this' (in gdb) might help root-cause the issue. If you could reload this core file and execute that command and paste the results here (assuming your sbbs still maps to that core file), that might be very helpful.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Apr 8 20:51:41 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/545#note_3449

    The gdb dump of "*this" provided the clue I think I needed. Everything on/after sbbs_t::wordwrap was corrupted, including the `usrsub` array that was being freed at the time of crash.The sbbs_t::wordwrap is only used in sbbs_t::getstr() when the K_WRAP mode flag is used, which isn't often. It is used by the internal message editor, so I was able to reproduce the corruption by writing long lines and verified the corruption using gdb (now immediately follows wordwrap in sbbs_t, and should be a valid time_t value):```Thread 16 "sbbs/termNode" hit Breakpoint 2, sbbs_t::getstr (this=0x7d445c0b8400, strout=0x7d44695ea830 "", maxlen=193, mode=524952, history=0x0) at getstr.cpp:540540 if(x<(maxlen/2)) {(gdb) print z <- z is the last write index into wordwrap[]$8 = 108 <- whoops!(gdb) print wordwrap$9 = 'x' <repeats 81 times>(gdb) print now$10 = 8680820740569200760 <- bad time_t value```
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Sat Apr 8 21:17:23 2023
    close https://gitlab.synchro.net/main/sbbs/-/issues/545
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)