Tcl Source Code

View Ticket
Login
Ticket UUID: 671624
Title: enable-threads on FreeBSD5.0
Type: Bug Version: obsolete: 8.4.1
Submitter: taguchiv6 Created on: 2003-01-21 06:47:14
Subsystem: None Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Open Last Modified: 2003-11-13 08:53:51
Resolution: None Closed By:
    Closed on:
Description:
I'm tring to --enable-thread on my FreeBSD 5.0-RELEASE box.
compiling was passed. and almost make tests were passed.
but I found following 2 probrems.

(1) stack.test dump core.
Here is a stack trace.
BEGIN>---<CUT HERE>---
#0  0x280e06fc in TclObjInterpProc
(clientData=0x808c208, interp=0x806f008,  
    objc=1, objv=0x8077b30) at ../generic/tclProc.c:903 
#1  0x2808b29d in TclEvalObjvInternal
(interp=0x806f008, objc=1,  
    objv=0x8077b30, command=0x0, length=0, flags=0) 
    at ../generic/tclBasic.c:3048 
#2  0x280b0860 in TclExecuteByteCode (interp=0x806f008,
codePtr=0x80b5c08) 
    at ../generic/tclExecute.c:1431 
#3  0x280aff35 in TclCompEvalObj (interp=0x806f008,
objPtr=0x8072480) 
    at ../generic/tclExecute.c:1008 
#4  0x280e0b47 in TclObjInterpProc
(clientData=0x808c208, interp=0x806f008,  
    objc=1, objv=0x8077b2c) at ../generic/tclProc.c:1082 
#5  0x2808b29d in TclEvalObjvInternal
(interp=0x806f008, objc=1,  
    objv=0x8077b2c, command=0x0, length=0, flags=0) 
    at ../generic/tclBasic.c:3048 
#6  0x280b0860 in TclExecuteByteCode (interp=0x806f008,
codePtr=0x80b5c08) 
    at ../generic/tclExecute.c:1431 
..... <snip>...
#2843 0x280aff35 in TclCompEvalObj (interp=0x806f008,
objPtr=0x8072ff0) 
    at ../generic/tclExecute.c:1008 
#2844 0x2808c2bb in Tcl_EvalObjEx (interp=0x806f008,
objPtr=0x8072ff0, flags=0)     at
../generic/tclBasic.c:3944 
#2845 0x28090647 in Tcl_CatchObjCmd (dummy=0x0,
interp=0x806f008, objc=3,  
    objv=0x806f008) at ../generic/tclCmdAH.c:254 
#2846 0x2808b29d in TclEvalObjvInternal
(interp=0x806f008, objc=3,  
    objv=0x807700c, command=0x0, length=0, flags=0) 
    at ../generic/tclBasic.c:3048 
#2847 0x280b0860 in TclExecuteByteCode
(interp=0x806f008, codePtr=0x8070208) 
    at ../generic/tclExecute.c:1431 
#2848 0x280aff35 in TclCompEvalObj (interp=0x806f008,
objPtr=0x8072828) 
    at ../generic/tclExecute.c:1008 
#2849 0x2808c2bb in Tcl_EvalObjEx (interp=0x806f008,
objPtr=0x8072828,  
    flags=131072) at ../generic/tclBasic.c:3944 
#2850 0x280bccaa in Tcl_RecordAndEvalObj
(interp=0x806f008, cmdPtr=0x8072828,  
    flags=131072) at ../generic/tclHistory.c:142 
#2851 0x280d1d55 in Tcl_Main (argc=1, argv=0xbfbffb84,  
    appInitProc=0x8048680 <Tcl_AppInit>) at
../generic/tclMain.c:390 
#2852 0x08048673 in main (argc=134791688, argv=0x808c208) 
    at ../unix/tclAppInit.c:90 
#2853 0x08048585 in _start () 
END>---<CUT HERE>----
maxNestingDepth in TclInterpReady() was 710 (< 1000!).
I think MAX_NESTING_DEPTH in tclInt.h may be 700.
Or Should TclpCheckStackSpace be imprement?
I think changing MAX_NESTING_DEPTH is never beautiful.
Does anyone know excelent solution?

(2) configure never detect pthread_attr_setstacksize(3T)
unix/configure can not detect pthread_attr_setstacksize.

here is a config.log:
BEGIN>---8<CUT HERE>8---
configure:1231: checking for pthread_attr_setstacksize 
configure:1259: cc -o conftest -O -pipe -g
-march=pentium3   conftest.c  1>&5 
/var/tmp//ccVFfbD7.o: In function `main': 
/usr/ports/lang/tclsh84-ext/work/tcl8.4.1/unix/configure:1253:
undefined refere\nce to `pthread_attr_setstacksize' 
END>---8<CUT HERE>8---
cc does not have -pthread (= $THREADS_LIBS) as its
args, so checking for this function will fail.
If add -pthreads manually, then check will success.

Sorry I've try to make a patch for tcl.m4, but I couldn't
do it.

Thanks.
---
Taguchi,T.
User Comments: hobbs added on 2003-02-15 09:08:14:
Logged In: YES 
user_id=72656

The attached sort of cheats on adding those #defines when 
they are not otherwise found.  Either there is a autoconf 
problem in determining whether those functions exist, or we 
aren't looking in the right place in SC_ENABLE_THREADS.

taguchiv6 added on 2003-01-22 12:36:56:

File Added - 40308: patch-tcl-m4-2

taguchiv6 added on 2003-01-22 12:36:55:
Logged In: YES 
user_id=357728

Thanks Jeff!
I should read your comments and some entries for other OS in
tcl.m4.

I've made a patch for tcl.m4.
and it's seem work fine!

Thanks.

hobbs added on 2003-01-21 14:08:43:
Logged In: YES 
user_id=72656

This is a fairly well known problem for systems that default to 
very low default stack sizes for threads.  Read the stack.test 
file to see if the notes there correct your problem.

Otherwise, it looks like we need to figure out how to verify the 
right threads libs on FreeBSD-5.

taguchiv6 added on 2003-01-21 13:53:11:
Logged In: YES 
user_id=357728

Sorry I forgot to say which verion I used.
tcl8.4.1 and cvsuped yesterday have this probrem.
Thanks.
---
Taguchi,T.

Attachments: