|
2009-12-08
| ||
| 03:50 | • Closed ticket [2910094fff]: info frame broken in coros plus 7 other change... artifact: 8a92ae0b3d user: msofer | |
| 02:59 | • Ticket [2910094fff]: 4 changes artifact: 478ef255d0 user: andreas_kupries | |
| 02:57 | • Ticket [2910094fff]: 4 changes artifact: 0a85f27b51 user: andreas_kupries | |
| 02:55 | • Ticket [2910094fff]: 4 changes artifact: d9c62b7c27 user: andreas_kupries | |
| 02:53 | • Ticket [2910094fff]: 4 changes artifact: 0ece787398 user: andreas_kupries | |
| 02:53 | • Ticket [2910094fff]: 4 changes artifact: b4cfbb0efa user: andreas_kupries | |
| 02:18 | • Add attachment infoframedebug.tcl to ticket [2910094fffffffff|2910094ff... artifact: cc44a495b9 user: andreas_kupries | |
| 02:18 | • Ticket [2910094fff] info frame broken in coros status still Open with 4 ot... artifact: 457fe9c4a9 user: andreas_kupries | |
|
2009-12-07
| ||
| 16:14 | • New ticket [2910094fff]. artifact: dd9ad2444f user: msofer | |
[info frame] broken in coros
Closed / Fixed2910094fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-12-07 16:14:34
% proc stack {} {
puts LEVEL:[set lev [info frame]]
for {set i 1} {$i < $lev} {incr i} {
puts [info frame $i]
}
}
% stack
LEVEL:2
type eval line 1 cmd stack level 1
% proc a {} stack
% a
LEVEL:3
type eval line 1 cmd a level 2
type proc line 1 cmd stack proc ::a level 1
% coroutine aa a
LEVEL:5
bad level "1"
andreas_kupriesplain2009-12-08 02:18:23
File Added - 354261: infoframedebug.tcl
andreas_kupriesplain2009-12-08 02:53:54
I confirm, using my own frame dumper (which starts from the current from down to 1, so I am able to see some output before it croaks, my code is attached here). Output is
andreask@gila:~/workbench/Coro280> ./install/tcl86/bin/tclsh8.6
% source infoframedebug.tcl
% debugframes
FRAME 2 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 1 {type eval line 1 cmd debugframes level 1}
% proc a {} debugframes
% a
FRAME 3 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 2 {type proc line 1 cmd debugframes proc ::a level 1}
FRAME 1 {type eval line 1 cmd a level 2}
% coroutine aa a
FRAME 5 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 4 {type proc line 1 cmd debugframes proc ::a level 1}
FRAME 3 {type eval line 1 cmd a}
FRAME 2 {type eval line 1 cmd {coroutine aa a} level 2}
bad level "1"
% exit
It seems the trouble is where it tries to access the stack frames above the coroutine invokation.
The bad level is either thrown for out of range, or, for in-range numbers, if the loop in lines 1142-1148 (tclCmIL.c, rev 1.174) is not finding a frame. That would indicate that the framePtr->nextPtr chain is broken at the point of main to coro transition.
This is likely managed in the code switching between coros, right ?
andreas_kupriesplain2009-12-08 02:53:59
I confirm, using my own frame dumper (which starts from the current from down to 1, so I am able to see some output before it croaks, my code is attached here). Output is
andreask@gila:~/workbench/Coro280> ./install/tcl86/bin/tclsh8.6
% source infoframedebug.tcl
% debugframes
FRAME 2 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 1 {type eval line 1 cmd debugframes level 1}
% proc a {} debugframes
% a
FRAME 3 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 2 {type proc line 1 cmd debugframes proc ::a level 1}
FRAME 1 {type eval line 1 cmd a level 2}
% coroutine aa a
FRAME 5 {type source line 6 file infoframedebug.tcl cmd {info frame $level} proc ::debugframes level 0}
FRAME 4 {type proc line 1 cmd debugframes proc ::a level 1}
FRAME 3 {type eval line 1 cmd a}
FRAME 2 {type eval line 1 cmd {coroutine aa a} level 2}
bad level "1"
% exit
It seems the trouble is where it tries to access the stack frames above the coroutine invokation.
The bad level is either thrown for out of range, or, for in-range numbers, if the loop in lines 1142-1148 (tclCmIL.c, rev 1.174) is not finding a frame. That would indicate that the framePtr->nextPtr chain is broken at the point of main to coro transition.
This is likely managed in the code switching between coros, right ?
andreas_kupriesplain2009-12-08 02:55:46
IP - Comment Removed: 204.244.102.2
andreas_kupriesplain2009-12-08 02:57:20
An alternative is that the calculation of levels in the coroutine is off by one, i.e. that info frame should show only the coro stack up to what we see in my output as level 2.
andreas_kupriesplain2009-12-08 02:59:48
Assuming the alternative is true the fix would be to remove the +1 in line 1103 of file tclCmdIL.c, rev 1.174.
msoferplain2009-12-08 03:50:12
allow_comments - 1 That did it; committed.
Log in (anonymous is fine) to add a comment.
Attachments:
- infoframedebug.tcl [download] added by andreas_kupries on 2009-12-08 02:18:23. [details]