|
2026-11-20
| ||
| 08:03 | Fix [302782]: time limit timer callback could re-run leaf check-in: e1d38620ff user: jan.nijtmans tags: core-9-0-branch | |
|
2026-11-19
| ||
| 22:55 | Fix [302782]: time limit timer callback could re-run check-in: cded168d12 user: jan.nijtmans tags: trunk, main | |
| 22:53 | • Closed ticket [3048170fff]: bgerror called when limit exceed proc calls vwait<... artifact: b4b1f20d03 user: jan.nijtmans | |
|
2026-10-17
| ||
| 09:30 | • Ticket [3048170fff]: 4 changes artifact: 369e48e9f7 user: serhiy.storchaka | |
| 09:30 | • Ticket [3027822fff] Failure of expr with interp limit and vwait status... artifact: 0254b353f9 user: serhiy.storchaka | |
| 09:22 | Fix [3027822fff] and [3048170fff]: the time limit timer callback could re-run the limit check while ... closed check-in: b8ee0282eb user: serhiy.storchaka tags: time-limit-handler-reentry | |
|
2010-07-10
| ||
| 22:55 | • Ticket [3027822fff] Failure of expr with interp limit and vwait status... artifact: fd815e3423 user: kjnash | |
| 22:55 | • Add attachment testInterpLimits.tcl to ticket [3027822fffffffff|3027822... artifact: c6dc0fed56 user: kjnash | |
| 15:55 | • New ticket [3027822fff] Failure of expr with interp limit and vwait. artifact: dc7b8205c9 user: kjnash | |
| Ticket UUID: | 3027822 | ||
| Title: | Failure of [expr] with [interp limit] and [vwait] | ||
| Type: | Bug | Created on: | 2010-07-10 15:55:49 |
| Submitter: | kjnash | Assigned to: | hobbs |
| Subsystem: | 20. [interp] | Severity: | |
| Priority: | 5 Medium | Last modified: | 2026-10-17 09:30:42 |
| Status: | Open | Closed by: | |
| Resolution: | None | Closed on: | |
| Version: | 8.6.18, 9.0.5, 9.1.0 | ||
| Description: | ||||
The example code (in file attachment) starts a slave interpreter and sets a time limit of 2 seconds. Then it sends the slave into a loop evaluating an [expr] at each iteration.
When the time limit is reached, the master interpreter spends 200ms in the event loop, then renews the slave's [interp limit]. The bug is that when the slave interpreter resumes execution, its state appears to have changed, and the [expr] command fails.
There appear to be no events that could have changed the slave interpreter's state; in any case, such events should not be serviced while the interpreter has exceeded its limits (which includes all the time spent in the event loop).
It is not completely perverse to enter the event loop during an [interp limit] event - one reason would be while posting a dialog to ask the user whether or not to renew a runaway interpreter's limits.
$ tclsh testInterpLimits.tcl
NewSecondsLimit interp0 0.006
NewSecondsLimit interp0 1.864
can't use empty string as operand of "*"
while executing
"expr {cos($nloop) * sin($nloop)}"
invoked from within
"interp eval $int1 {
for {set nloop 0} {$nloop < 10000000} {incr nloop} {
set result [expr {cos($nloop) * sin($nloop)}]
}
}"
(file "testInterpLimits.tcl" line 19)
| ||||
| User Comments: | ||||
kjnash added on 2010-07-10 22:55:49:
File Added - 379703: testInterpLimits.tcl serhiy.storchaka added on 2026-10-17 09:30:42:
Still present in 8.6–9.1. The child hits its time limit, the limit handler enters [vwait], and the child's pending time-limit timer fires there. It runs the limit check again and raises a background error in the busy child, which clobbers the child's interp result. The math function then returns garbage to [expr]. Proposed fix in branch time-limit-handler-reentry: TimeLimitCallback does nothing while the time limit is marked exceeded, i.e. while its handlers are running. The outer check decides, and a new limit re-arms the timer. This also fixes [3048170fff]. Test interp-34.15. | ||||
Attachments:
- testInterpLimits.tcl [download] added by kjnash on 2010-07-10 22:55:49. [details]
