Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-26
15:29 • Closed ticket [219324ffff]: (tcltest) ThreadErrorProc not always called plus... artifact: 2ba9b1eef4 user: davygrvy
14:43 • Ticket [219324ffff]: 2 changes artifact: 5a41aa6055 user: davygrvy
07:35 • Ticket [219324ffff]: 5 changes artifact: 3bd5e5ffb0 user: davygrvy
04:41 • Ticket [219324ffff]: 4 changes artifact: 68cc8c5343 user: davygrvy
2000-10-26
05:10 • New ticket [219324ffff]. artifact: 5cd2100413 user: nobody

(tcltest) ThreadErrorProc not always called

Closed / Fixed219324ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 05:10:45
OriginalBugID: 3957 Bug
Version: 8.2.3
SubmitDate: '1999-12-29'
LastModified: '2000-10-25'
Severity: MED
Status: UnAssn
Submitter: techsupp
OS: SunOS
OSVersion: 5.6
Machine: Sun Ultra
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:

Peter Silsbee


Extensions:

With tcltest, none. Separately, Expect, Tk, tix.


CustomShell:

N/A


Comments:

Patch is tentative. I'm totally unfamiliar with Tcl source, and have basically no idea what side effects it might cause!


ReproducibleScript:

Command line: tcltest script.tcl


script.tcl:


set errorthread [testthread create]


set cmd "proc errorHandler \{id ei\} \{\

puts \"This is my error procedure.\";\

puts \"The thread is \$id\";\

puts \"The errorInfo is <\$ei>\";\

}"


testthread send $errorthread $cmd

testthread send $errorthread "testthread errorproc errorHandler"


puts "About to commit an error in non-waiting thread"

testthread create "set nonexistent"


set thread2 [testthread create]


puts "About to commit an error in the thread that is waiting"

testthread send $thread2 "set nonexistent"


after 2000


puts "I survived to the end of the script"

puts "The remaining threads are [testthread names]"


ObservedBehavior:

The procedure "errorHandler" is only called when an error occurs during "testthread create" script evaluation. When an error occurs during "testthread send" evaluation, ThreadErrorProc is never called.


DesiredBehavior:

ThreadErrorProc, hence errorHandler if registered, should be called on any thread error?


Patch:

*** generic/tclThreadTest.c.oldSat Oct 30 05:06:01 1999

--- generic/tclThreadTest.c.newWed Dec 29 10:27:35 1999

***************

*** 817,822 ****

--- 817,830 ----

  if (code != TCL_OK) {

      errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY);

      errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);

+     ThreadErrorProc(interp);

+     if (errorProcString != NULL) {

+       /*

+        * assume registered error handler can take care of things

+        */

+       code = TCL_OK;

+       errorCode = errorInfo = NULL;

+     }

  } else {

      errorCode = errorInfo = NULL;

  }


PatchFiles:

tclThreadTest.c
davygrvyplain2001-04-26 04:41:41
Logged In: YES 
user_id=7549

please change catagory to the thread package.
davygrvyplain2001-04-26 07:35:27
Logged In: YES 
user_id=7549

This is also a thread package issue, too, so I'll group it 
there.
davygrvy Ticket [219324ffff]: 2 changes [History diff]2001-04-26 14:43:02
davygrvyplain2001-04-26 15:29:07
Logged In: YES 
user_id=7549

All fixed.  Thanks for the new feature.

NOTICE: this has been adopted into the thread extension 
rather than the testthread extension of the test suite.
Log in (anonymous is fine) to add a comment.