• js.exec caused core jump

    From Nigel Reed@VERT to GitLab issue in main/sbbs on Fri Sep 1 12:22:46 2023
    open https://gitlab.synchro.net/main/sbbs/-/issues/611

    in my chat javascript menu file

    js.exec("../xtrn/mrc/mrc-client.js",null,"/sbbs/xtrn/mrc/");

    I had just changed bbs.exec to js.exec without checking the parameters.

    ~~~
    [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--c
    Core was generated by `/sbbs/exec/sbbs d'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x00007f7f5883fdd6 in JSObject::getClass (this=0x0) at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsobj.h:427
    427 /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsobj.h: No such file or directory.
    [Current thread is 1 (Thread 0x7f7ee09fd640 (LWP 984457))]
    (gdb) bt
    #0 0x00007f7f5883fdd6 in JSObject::getClass (this=0x0) at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsobj.h:427
    #1 0x00007f7f5883fdf8 in JSObject::getOps (this=0x0) at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsobj.h:435
    #2 0x00007f7f588401d0 in JSObject::defineProperty (this=0x0, cx=0x7f7ed406e6e0, id=140182618251712, value=..., getter=0x0, setter=0x0, attrs=3)
    at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsobj.h:1223
    #3 0x00007f7f58836e1a in DefinePropertyById (cx=0x7f7ed406e6e0, obj=0x0, id=140182618251712, value=..., getter=0x0, setter=0x0, attrs=3, flags=0,
    tinyid=0) at jsapi.cpp:3420
    #4 0x00007f7f58837055 in DefineProperty (cx=0x7f7ed406e6e0, obj=0x0, name=0x7f7f58c7d370 "argv", value=..., getter=0x0, setter=0x0, attrs=3,
    flags=0, tinyid=0) at jsapi.cpp:3457
    #5 0x00007f7f588370d9 in JS_DefineProperty (cx=0x7f7ed406e6e0, obj=0x0, name=0x7f7f58c7d370 "argv", value=18445617618932470848, getter=0x0,
    setter=0x0, attrs=3) at jsapi.cpp:3464
    #6 0x00007f7f586fed5d in js_execfile (cx=0x7f7ed406e6e0, argc=3, arglist=0x7f7ecf3ff0a0) at js_internal.c:407
    #7 0x00007f7f58ae60c7 in js::CallJSNative (vp=0x7f7ecf3ff0a0, argc=3, native=0x7f7f586fdff3 <js_execfile>, cx=0x7f7ed406e6e0)
    at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jscntxtinlines.h:701
    #8 js::Interpret (cx=0x7f7ed406e6e0, entryFrame=0x7f7ecf3ff048, inlineCallCount=0, interpMode=JSINTERP_NORMAL) at jsinterp.cpp:4799
    #9 0x00007f7f588d85c6 in js::RunScript (cx=0x7f7ed406e6e0, script=0x7f7ed417b8a0, fp=0x7f7ecf3ff048)
    at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsinterp.cpp:653 #10 0x00007f7f588db55f in js::Execute (cx=0x7f7ed406e6e0, chain=0x7f7ecf29ac18, script=0x7f7ed417b8a0, prev=0x0, flags=0, result=0x7f7ee09f6078)
    at /home/bbs/sbbs-test/repo/3rdp/src/mozjs/js-1.8.5/js/src/jsinterp.cpp:1028
    #11 0x00007f7f5883c3a1 in JS_ExecuteScript (cx=0x7f7ed406e6e0, obj=0x7f7ecf29ac18, scriptObj=0x7f7ecf29ad80, rval=0x7f7ee09f6078) at jsapi.cpp:4998
    #12 0x00007f7f5865f971 in sbbs_t::js_execfile (this=0x7f7f485bf9a0, cmd=0x7f7ee09fb920 "eotl_chat", startup_dir=0x0, scope=0x0,
    js_cx=0x7f7ed406e6e0, js_glob=0x7f7ecf203048) at exec.cpp:676
    #13 0x00007f7f58660014 in sbbs_t::exec_bin (this=0x7f7f485bf9a0, cmdline=0x7f7ee09fb920 "eotl_chat", csi=0x7f7f485d1c78, startup_dir=0x0)
    at exec.cpp:770
    #14 0x00007f7f586623ef in sbbs_t::exec (this=0x7f7f485bf9a0, csi=0x7f7f485d1c78) at exec.cpp:1331
    #15 0x00007f7f58780938 in node_thread (arg=0x7f7f485bf9a0) at main.cpp:4305
    #16 0x00007f7f582d8b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
    #17 0x00007f7f5836aa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
    ~~~

    Let me know if you need anything else.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab issue in main/sbbs on Fri Sep 1 12:32:49 2023
    close https://gitlab.synchro.net/main/sbbs/-/issues/611

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net