From: SourceForge.net <no...@so...> - 2007-01-20 09:25:21
|
Bugs item #1618411, was opened at 2006-12-18 13:44 Message generated for change (Comment added) made by mistachkin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1618411&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 48. Threading Group: development: 8.5a6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arkadiusz Miskiewicz (arekm) Assigned to: Joe Mistachkin (mistachkin) Summary: TclpCheckStackSpace() fails on recent linux system Initial Comment: 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 ---------------------------------------------------------------------- >Comment By: Joe Mistachkin (mistachkin) Date: 2007-01-20 01:25 Message: Logged In: YES user_id=113501 Originator: NO Bug repro verified. It appears the x86_64 pthread library is indeed blowing smoke. The returned maximum stack size appears to be totally random. Excerpt from run #1: stack OK in:0x7fffff8cb70c out:0x7fffff8cca2c use:1320 max:209BE000 Excerpt from run #2: stack OK in:0x7ffffffdf96c out:0x7ffffffe0c8c use:1320 max:3532D000 Excerpt from run #3: stack OK in:0x7fffff8f89bc out:0x7fffff8f9cdc use:1320 max:4BC99000 ---------------------------------------------------------------------- Comment By: Joe Mistachkin (mistachkin) Date: 2007-01-19 23:25 Message: Logged In: YES user_id=113501 Originator: NO It would be useful to have the "aaa.tcl" script mentioned in the bug if it is doing something special. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2006-12-20 02:04 Message: Logged In: YES user_id=79902 Originator: NO Either the calculation of the stack size is wrong (which I could believe; perhaps the x86_64 pthread library is blowing smoke in our eyes here?) or the comparison on line 1092 of tclUnixInit.c is wrong and the sign is causing trouble. Alas, I can't test because I don't have an x86_64 Unix machine conveniently available at the moment either... ---------------------------------------------------------------------- Comment By: Joe Mistachkin (mistachkin) Date: 2006-12-19 19:53 Message: Logged In: YES user_id=113501 Originator: NO I can help work on this; however, I have no box that can repro the issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1618411&group_id=10894 |