Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-09-19
09:20 • Closed ticket [1783443fff]: apache and websh plus 6 other changes artifact: 09c8fee404 user: sf-robot
2007-09-04
20:20 • Pending ticket [1783443fff]. artifact: 3ca6fd02fc user: msofer
19:40 • Ticket [1783443fff]: 4 changes artifact: a04455d77b user: rbrunner
2007-08-29
15:30 • Ticket [1783443fff]: 4 changes artifact: 392b13b546 user: zackya
2007-08-28
22:02 • Ticket [1783443fff]: 5 changes artifact: f0373614e3 user: msofer
14:41 • New ticket [1783443fff]. artifact: 169468903d user: nobody

apache and websh

Closed / Invalid1783443fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-08-28 14:41:09
Tcl 8.4.15 
Windows 2003 Service Pack 1 
Apache: 2.2.4 
Tcl: 8.4.15 
Websh: Websh 3.6.b4 (2006-03-05) 

I have a simple test that bring the server time and date the page is refreshed every 3 second (just testing). 

After opening 20 pages the web server is crash. 

[Sun Aug 26 13:33:25 2007] [notice] Child 448: Starting thread to 
listen on port 2080. 
alloc: invalid block: 008ED5B0: f8 0 0 


This application has requested the Runtime to terminate it in an 
unusual way. 
Please contact the application's support team for more information. 
[Sun Aug 26 13:37:11 2007] [crit] Parent: child process exited with 
status 3 -- Aborting.
msoferplain2007-08-28 22:02:33
Logged In: YES 
user_id=148712
Originator: NO

This seems to be the issue discussed on clt at
http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/ae1d5f9d3c4e25bd/a73b0ca5e0298b04#a73b0ca5e0298b04

There it is reported that the failure occurs with both 8.4.15 with
   alloc: invalid block: 008ED5B0: f8 0 0
and under 8.5 (version 8.5b8??) with
   TclStackFree: incorrect freePtr.  Call out of sequence?
It is reported that the crash occurs under Win2003, but not with XP.

This looks like a buffer overrun (someone stomping over allocation block info, either zippy's or TclStackAlloc's). But it could be mem corruption of some other type, or who knows what.

Not much chance to progress without a stack trace - not even to determine if this is a websh or tclsh problem. Any other suspects around - ie, binary extensions loaded? Requesting further assistance from reporter on clt
zackyaplain2007-08-29 15:30:46
Logged In: YES 
user_id=1878237
Originator: NO

Hi, 

I don't know if this is relative but I got the following results: 

I compile tcl 8.4.15 on windows xp and 2003 run the Tcl's 
testsuite. 

Window XP Service Pack 2 
Tcl 8.4.15 
Compile and Test are ok 
Tests ended at Mon Aug 27 09:05:14 Jerusalem Daylight Time 2007 
all.tcl:        Total   10920   Passed  10139   Skipped 781 
Failed  0 


Windows 2003 Service Pack 1 
Tcl 8.4.15 
Compile Pass 
Test Failed 


httpold.test 


==== httpold-4.12 httpEvent FAILED 
==== Contents of test case: 


    update 
    set x {} 
    after 500 {lappend x ok} 
    set token [http_get $url -timeout 1 -command {lappend x fail}] 
    vwait x 
    list [http_status $token] $x 


---- Result was: 
ok ok 
---- Result should have been (exact matching): 
timeout ok 
==== httpold-4.12 FAILED 


Tests ended at Mon Aug 27 11:42:05 AM Jerusalem Daylight Time 2007 
all.tcl:        Total   10920   Passed  10145   Skipped 774 
Failed  1 


I run also run the httpold.test test 20 time with the same result 
Windows xp 20 pass 
Windows 2003 20 fail 


I copy 2003 compilation result to XP run the httpold.test test and it 
pass 
I copy XP compilation result to 2003 run the httpold.test test and it 
fail 


Regards Zacky
rbrunnerplain2007-09-04 19:40:04
Logged In: YES 
user_id=205230
Originator: NO

I found a potential problem in Websh on Server 2003 (don't ask me why it should be different on that platform...)

Is the following code correct (it's Websh code, not Tcl code)?

    Tcl_Obj *tmp = NULL;   
    tmp = Tcl_NewStringObj(source, length);
    var = Tcl_ObjSetVar2(interp, varname,
             NULL,
             tmp,
             TCL_GLOBAL_ONLY | TCL_APPEND_VALUE |
             TCL_LEAVE_ERR_MSG);

    Tcl_DecrRefCount(tmp);

Note that there is no Tcl_IncrRefCount(tmp) before the call to Tcl_ObjSetVar2(). I thought this should work, but it crashes on Win Server 2003...

If I indeed need to fix this, I'll send a patched version to the OP (assuming it was zackya) so he can check if the error still occurs.

Please advise...
msoferplain2007-09-04 20:20:49
Logged In: YES 
user_id=148712
Originator: NO

No, that is wrong: you should Tcl_IncrRefCount(tmp) before calling Tcl_ObjSetVar2(). See http://wiki.tcl.tk/14880 for guidance on these issues.

Why the problem is only apparent on Server 2003: a mystery. It is always wrong, $varname will be just about anything after this: the obj has been freed, it will be reused for something else (assuming a standard Tcl compilation).

[*] If the refCount is not incr/decr, Tcl (pre 8.5, not anymore in HEAD) will leak the Tcl_Obj whenever a variable called 'varname' cannot be set - for instance, if it refers to a non-existing namespace.
sf-robotplain2007-09-19 09:20:03
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.