Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 56c119811c6f8fe59533ba9af1d7224d769913fb
Ticket: 1618411fffffffffffffffffffffffffffffffff
TclpCheckStackSpace() fails on recent linux system
User & Date: arekm on 2006-12-18 21:44:30
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    tcl fail randomly with:
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    
    this is Linux 2.6.16, glibc 2.5, x86_64 system, testing vanilla tcl 8.5 a5 configured as:
    ./configure --enable-threads
    
    Note that --enable-threads seems to be needed to reproduce the problem. Also I needed to run tclsh via make call to reproduce the problem - direct running tclsh aaa.tcl didn't trigger it.
    
    While tracking the problem with dgp@jabber we found that problem is in TclpCheckStackSpace() function.
    
    Further investigation shows that that this function seem to be wrong on recent Linux/glibc systems where many things are randomized (see http://gcc.gnu.org/wiki/Randomization) and finally we found out that disabling memory address space randomization makes  TclpCheckStackSpace() pass:
    sysctl -w kernel.randomize_va_space=0
    
    Looks like  TclpCheckStackSpace() isn't ready for recent systems with randomization stuff (which means any recent linux distro).
    
    Test case:
    [arekm@arm ~/tcl]$ ls
    aaa.tcl  Makefile
    [arekm@arm ~/tcl]$ cat aaa.tcl
    [arekm@arm ~/tcl]$ cat Makefile
    test:
            tclsh aaa.tcl > bbb.txt
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    application-specific initialization failed: too many nested evaluations (infinite loop?)
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    [arekm@arm ~/tcl]$ make test
    tclsh aaa.tcl > bbb.txt
    [arekm@arm ~/tcl]$     
    
    with stack debugging:
    [arekm@arm ~/tcl]$ make test
    /home/users/arekm/tcl-test/bin/tclsh8.5 aaa.tcl
    stack OVERFLOW  in:0x7fffffa9c4e4       out:0x7fffffa9c4e4      use:0000        max:F06E2000
    application-specific initialization failed XXX: too many nested evaluations (infinite loop?)
    stack OVERFLOW  in:0x7fffffa9c954       out:0x7fffffa9c4e4      use:0470        max:F06E2000
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "arekm"
  10. subsystem changed to: "49. Threading"
  11. title changed to: "TclpCheckStackSpace() fails on recent linux system"
  12. type changed to: "Bug"