|
2012-04-27
| ||
| 03:06 | • Closed ticket [3301634fff]: Thread release crash plus 8 other changes artifact: 3097b16784 user: dgp | |
|
2012-04-11
| ||
| 03:01 | • Ticket [3301634fff]: 4 changes artifact: d20db8b458 user: tombert | |
|
2012-04-10
| ||
| 20:36 | • Ticket [3301634fff]: 4 changes artifact: 8a44527beb user: dkf | |
| 20:27 | • Ticket [3301634fff]: 4 changes artifact: c5afa6a0a3 user: sebres | |
| 16:00 | • Ticket [3301634fff]: 4 changes artifact: 86ef23e231 user: tombert | |
|
2011-08-19
| ||
| 00:56 | • Ticket [3301634fff]: 4 changes artifact: 6085c8cd30 user: tombert | |
|
2011-08-18
| ||
| 22:59 | • Ticket [3301634fff]: 4 changes artifact: 841375291c user: vasiljevic | |
| 22:47 | • Ticket [3301634fff]: 4 changes artifact: 1eea40ca17 user: andreas_kupries | |
| 17:00 | • Ticket [3301634fff]: 4 changes artifact: d08fad0902 user: tombert | |
| 16:56 | • Ticket [3301634fff]: 5 changes artifact: f7fc8b230a user: tombert | |
|
2011-05-13
| ||
| 22:19 | • Ticket [3301634fff]: 4 changes artifact: a511737591 user: tombert | |
| 22:15 | • Add attachment util.tcl to ticket [3301634fff] artifact: 57c8ccb90b user: tombert | |
| 22:15 | • Ticket [3301634fff] Thread release crash status still Open with 4 other chan... artifact: f5e3f88673 user: tombert | |
| 22:15 | • Add attachment socket_crash.itcl to ticket [3301634fffffffff|3301634fff... artifact: e684907cf2 user: tombert | |
| 22:15 | • Ticket [3301634fff] Thread release crash status still Open with 4 other chan... artifact: d407c30b2e user: tombert | |
| 22:14 | • Ticket [3301634fff]: 4 changes artifact: 627a0201b5 user: tombert | |
| 22:14 | • Add attachment crash.tcl to ticket [3301634fff] artifact: fccb2629c6 user: tombert | |
| 15:14 | • New ticket [3301634fff] Thread release crash. artifact: 9299b2238d user: tombert | |
Thread release crash
Closed / Out of Date3301634fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 15 years ago
Descriptionplain2011-05-13 15:14:13
Environment Windows7, TCL 8.5.9 release and HEAD, compiled with MinGW
tombertplain2011-05-13 22:14:27
File Added - 411522: crash.tcl
tombertplain2011-05-13 22:15:34
File Added - 411523: socket_crash.itcl
tombertplain2011-05-13 22:15:57
File Added - 411524: util.tcl
tombertplain2011-05-13 22:19:23
Stripped down my application to reproduce the crash. The configured default path in the files point to d:/crash/... To reproduce call: wish crash.tcl If one removes a single procedure from the util.tcl the crash won't happen no more. Or you can remove a few method declarations from the socket_crash class, this will lead to an allocation error. Doing only "exit" without release works fine. thx for support
tombertplain2011-08-18 16:56:52
Example still crashes in 8.5.10 and latest thread package release. thx
tombertplain2011-08-18 17:00:55
Another interesting behaviour is calling (in a virgin wish): > package re Thread > thread::release [thread::id] which does nothing in the first attempt, but calling it a second time it reports that the thread does not exists. What is the expected result when releasing the main thread itself? thx
andreas_kupriesplain2011-08-18 22:47:22
Huh. Destruction of the main thread I would suspect to be a case of "pulling the rug out from under yourself".
vasiljevicplain2011-08-18 22:59:59
Releasing the main thread is syntactically possible and wrong. Actually releasing the 'current' thread ie. one calling the thread::release should be disabled or just a no-op'ed. I never thought of that as this is rarely practically done. Releasing (i.e. letting it die away) any thread is always connected with various cleanups that may go astray in certain situations. For example, you lock a mutex in a thread and then release the thread. Moreover, the Tcl lib was initially not desiged for thread safety. It is added some years later. So the entire cleanup/finalize machinery is not very thread-friendly and still assumes a "main" thread (the one that started the program) is always arround. So.,, you never exit a "main" thread (whichever that is) and I will add a block that will effectively no-op the release of the 'self' i.e current thread (as explained above). Cheers Zoran
tombertplain2011-08-19 00:56:38
ok - thx for the explanation, I'll take precaution not to release "myself" ...
... but this still leaves the crash open, I'll post a quick look into the code here:
package require Thread
proc crash {} {
set ::tid [thread::create {thread::wait}]
puts $::tid
thread::send $::tid {
package require Itcl
namespace import itcl::*
source d:/crash/socket_crash.itcl
source d:/crash/util.tcl
set obj [socket_crash "#auto"]
}
thread::release $::tid
}
after idle crash
tombertplain2012-04-10 16:00:16
Retested in WinXP, TCL 8.5.11, thread 2.7b1: does not crash. Have to try in W7.
sebresplain2012-04-10 20:27:21
possible duplicate to 3494470? https://sourceforge.net/tracker/?func=detail&aid=3494470&group_id=10894&atid=110894
dkfplain2012-04-10 20:36:49
Technically, since neither is actually particularly clearer as to the deep nature of the bug, we'd roll that one into this. My main concern is that we have code that can crash at all. That's Bad.
tombertplain2012-04-11 03:01:50
Cant reproduce any more with latest head. Tested XP and W7.
dgpplain2012-04-27 03:06:23
allow_comments - 1
Log in (anonymous is fine) to add a comment.
Attachments:
- util.tcl [download] added by tombert on 2011-05-13 22:15:57. [details]
- socket_crash.itcl [download] added by tombert on 2011-05-13 22:15:34. [details]
- crash.tcl [download] added by tombert on 2011-05-13 22:14:27. [details]