Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-02-22
17:57 • Closed ticket [1818565fff]: http::wait error plus 7 other changes artifact: 0a46f23556 user: patthoyts
2008-01-08
23:32 • Ticket [1818565fff]: 4 changes artifact: 4044c826da user: dgp
21:19 • Ticket [1818565fff]: 4 changes artifact: 8b54ee68e0 user: patthoyts
21:18 • Ticket [1818565fff]: 4 changes artifact: 4923ca6e69 user: patthoyts
2007-11-15
22:04 • Ticket [1818565fff]: 4 changes artifact: ecc8da3985 user: dgp
16:57 • Ticket [1818565fff]: 5 changes artifact: bbc658b0dd user: patthoyts
2007-10-23
13:50 • New ticket [1818565fff]. artifact: 9262ec5a29 user: dgp

http::wait error

Closed / Fixed1818565fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-10-23 13:50:22
I see this background error often when starting
tkchat 1.381 (packaged as a tkchat.kit).
The relevant versions are:
   Tcl 8.4.15
   Tk  8.4.15
   http 2.5.3

Might be a tkchat bug, but has at least
some appearance of bugginess/lack of robustness
in the http package.

can't read "state(status)": no such variable
can't read "state(status)": no such variable
    while executing
"return $state(status)"
    (procedure "http::wait" line 10)
    invoked from within
"http::wait $token"
    (procedure "http::geturl" line 253)
    invoked from within
"http::geturl http://tclers.tk/~jabber/current.html -timeout 15000  -command [list [namespace origin fetchurldone]  [namespace origin CheckVersionDone]..."
    (procedure "CheckVersion" line 2)
    invoked from within
"CheckVersion"
    (procedure "::tkchat::LoadHistory" line 15)
    invoked from within
"::tkchat::LoadHistory"
    ("after" script)
patthoytsplain2007-11-15 16:57:01
Logged In: YES 
user_id=202636
Originator: NO

This error occurs when the token has been deleted already for some reason. You can see this if we pass in a bogus array name:
% namespace eval xyz {}
% http::status ::xyz::1
can't read "state(status)": no such variable

The tkchat code in question has a command procedure so we don't call http::wait from http::geturl for reading but we have a -timeout so we call this for connection setup. So in http::Connect we must be getting an [eof] or a socket error but this should set the state(status) to 'error'. However we then call Finish which calls the user provided -command procedure and the tkchat one will cleanup the token.

I think whats going on is an error in connection sets an error status, calls the application command procedure which cleanup and then the vwait gets a chance to run and the http::wait finishes but with a deleted array.

If this is correct I think you should be seeing a tk_messageBox with a "Fetch URL error: ..." message from the tkchat command procedure at around the same time.
dgpplain2007-11-15 22:04:42
Logged In: YES 
user_id=80530
Originator: YES


that's sounding familiar.

Any chance this is another
appearance of 513385 ?
patthoytsplain2008-01-08 21:18:16
Logged In: YES 
user_id=202636
Originator: NO

tcllib bug #1860190 is another instance of this.
patthoytsplain2008-01-08 21:19:03
Logged In: YES 
user_id=202636
Originator: NO

Also tcllib bug #1835240
dgpplain2008-01-08 23:32:14
Logged In: YES 
user_id=80530
Originator: YES


There are other development tracks
for an "http" package besides the
one bundled with Tcl, right?

Do those other(s) suffer the same problem?

Do any of those others actually have maintainers?
patthoytsplain2008-02-22 17:57:30
Logged In: YES 
user_id=202636
Originator: NO

Changed the status command to check for the existence of the token and to return "error" if it is not present. The [wait] command now calls [status] which avoids the problem we see in the stack trace here.
Log in (anonymous is fine) to add a comment.