Menu

#2244 segfault in stack.test with threaded build on SuSE 8.0

obsolete: 8.5a0
closed-works-for-me
5
2004-03-26
2003-03-18
No

The threaded build from todays HEAD (18. March 2003)
crashes in stack.test on SuSE 8.0 (x86).

It doesn't crash on Redhat 7.3, according to migul sofer.
No crash on windows 2000 either.

This happens for both static and shared builds of tcl.

The crash happens in the first test stack 1.1 in
stack.test, the stack trace isn't nice (over 800
entries long, i didn't scroll to the end).

Discussion

  • miguel sofer

    miguel sofer - 2003-03-28

    Logged In: YES
    user_id=148712

    The stack.test failure mode is supposed to be a crash, and
    the stack trace will indeed be very deep: we are testing the
    max nest size there.

    Michael: what stack size do you see with 'ulimit'? Could you
    run the following script (WARNING: it will run for a while,
    fill your terminal with numbers and finally crash) and
    report the last number it outputs?

    proc recurse i {puts $i; recurse [incr i]}
    recurse 1

    Can anybody else confirm the bug on SuSE 8.0?

     
  • Nobody/Anonymous

    Logged In: NO

    bug confirmed with Tcl 8.4.2 on FreeBSD 4.8-RC.

    i get the error "Bus error (core dumped)" from "proc
    recurse i {puts $i; recurse [incr i]}; recurse 1" at only 518
    times.

    JJM

     
  • Nobody/Anonymous

    Logged In: NO

    (let's try this again, the SF interface is not working right)

    bug confirmed with Tcl 8.4.2 on FreeBSD 4.8-RC.

    i get the error "Bus error (core dumped)" from "proc
    recurse i {puts $i; recurse [incr i]}; recurse 1" at 518
    deep.

    JJM

     
  • miguel sofer

    miguel sofer - 2003-03-29

    Logged In: YES
    user_id=148712

    From the tcl'ers chat: JJM's build was threaded, patthoyts
    reports instead

    OpenBSD Tcl 8.4: at 1000: to many nested calls to Tcl_Eval.
    OpenBSD tcl 8.4.2: at 1000: too many nested evaluations
    (infinite loop?)
    Neither of mine are threaded.
    Ooooo Win2K Tcl 8.4.2 at 863: got the windows unknown
    software exception dialog

    Questions:
    (a) for Joe and Michael: what happens in a non-threaded build?
    (b) for Joe and Michael: what is the output of 'ulimit -s'
    (b) for Pat: Was that a threaded build on Win2K?
    (c) for all: does the failure happen also on older releases?

    Comments:
    Tcl checks for stack overflow in an indirect manner: it
    counts the nesting depth, and errors-out when it hits its
    maximum (1000 per default, configurable). What we are seeing
    is that the C-stack is exhausted before we hit the 1000
    limit, i.e., that we may have to use a smaller default max
    nesting depth. I'm trying to find out if the stack usage of
    Tcl grew lately ...

    On Win2K the matter is probably worse: there is a further
    check by the OS to prevent stack overflow, it is apparently
    not behaving correctly (per Pat's report).

     
  • Nobody/Anonymous

    Logged In: NO

    Michael Schlenker:

    Miguel i tested your [recurse] script, it segfaulted at 966.
    "ulimit -s" returns "unlimited"

    The crash does not happen with the nonthreaded build.

    I could not reproduce the crash under Win2k last time i tested, will check again tomorrow.

    Testing with older versions.

     
  • Nobody/Anonymous

    Logged In: NO

    Michael tested:

    tcl 8.4.1 crashes on the same SuSE Machine at 966 with the recurse script (threaded).

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Hmm. Do tests run in a separate thread in the threaded
    build? If so, we'll be hitting a separate limit (the
    default(?) stack size for a thread, as opposed to the main
    system stack size which is controlled by 'ulimit -s' IIRC.)

     
  • Nobody/Anonymous

    Logged In: NO

    > a) what happens in a non-threaded build?

    the non-threaded build appears to work.

    > (b) what is the output of 'ulimit -s'

    65536

    JJM

     
  • Marc Spitzer

    Marc Spitzer - 2003-05-29

    Logged In: YES
    user_id=779257

    happens in 8.4.3 with freebsd 4.8:
    > # make test TESTFLAGS="-file stack.test"
    LD_LIBRARY_PATH=`pwd`:;
    > export LD_LIBRARY_PATH;
    TCL_LIBRARY="/root/build/tcl8.4.3/library";
    > export TCL_LIBRARY; ./tcltest ./../tests/all.tcl -file
    stack.test
    > Tests running in interp: /root/build/tcl8.4.3/unix/tcltest
    > Tests located in: /root/build/tcl8.4.3/tests
    > Tests running in: /root/build/tcl8.4.3/unix
    > Temporary files stored in /root/build/tcl8.4.3/unix
    > Test files run in separate interpreters
    > Running tests that match: *
    > Skipping test files that match: l.*.test
    > Only running test files that match: stack.test
    > Tests began at Wed May 28 21:38:55 EDT 2003
    > stack.test
    > Test file error: child killed: bus error
    > Tests ended at Wed May 28 21:38:55 EDT 2003
    > all.tcl: Total 0 Passed 0 Skipped 0
    Failed 0
    > Sourced 1 Test Files.
    > Test files exiting with errors: stack.test

     
  • miguel sofer

    miguel sofer - 2004-03-26
    • status: open --> closed-works-for-me