Artifacts Associated With Ticket 3161787fffffffff
Ticket change [f1d151e680] (rid 109423) by tombert on 2011-01-19 15:34:54:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I run into this from a "bigger" application where I did call an unknown method from an itcl object - doing this several times the application crashes with an unhandled exception. The small example I posted below brings up an "unable to realloc xxxxx bytes" before but then crashes in the same manner. So I assume it's something with the error propagation between the threads ... How to reproduce: source the two procedures and call dotest from the console several times - sometimes it crashes on first call, sometimes I need to call it three times. Environment used: Windows XP, TCL 8.5.9, Thread 2.6.7, Itcl 3.4 proc thread_procCrash {args} { thread::send -async $::tid [concat testObj unkowncommand] } proc dotest {} { package re Thread set ::tid [thread::create {thread::wait}] ## create initial shared variables puts $::tid foreach package {Itcl} {thread::send $::tid [list package require $package]} foreach import {itcl::*} {thread::send $::tid [list namespace import $import]} thread::send $::tid {class TestClass { public method z {} {expr 1+1} public method a {} {expr 1+1} public method b {} {expr 1+1} public method c {} {expr 1+1} public method d {} {expr 1+1} public method e {} {expr 1+1} public method f {} {expr 1+1} public method g {} {expr 1+1} public method h {} {expr 1+1} public method i {} {expr 1+1} public method j {} {expr 1+1} public method k {} {expr 1+1} public method l {} {expr 1+1} public method m {} {expr 1+1} public method n {} {expr 1+1} public method o {} {expr 1+1} public method p {} {expr 1+1} public method q {} {expr 1+1} public method r {} {expr 1+1} public method s {} {expr 1+1} public method t {} {expr 1+1} public method u {} {expr 1+1} public method v {} {expr 1+1} public method w {} {expr 1+1} public method x {} {expr 1+1} public method y {} {expr 1+1} public variable hello {}} } thread::send $::tid {TestClass testObj} for {set index 0} {$index < 100000} {incr index} {thread_procCrash} } thx for your support - foundin initialized to: "obsolete: 8.5.9"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "tombert"
- subsystem initialized to: "49. Threading"
- title initialized to: "Unhandled exception with threaded itcl objects"
- type initialized to: "Bug"
Ticket change [98c81c597f] (rid 110672) by msofer on 2011-01-19 22:49:54:
- icomment:
No that "unable to realloc xxxx bytes" is the panic message in Tcl_Realloc, file tclCkAlloc.c. So this crash is actually a panic due to memory exhaustion. IOW, it may have little to do with the original, if the original did not have a similar message.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [c74291364f] (rid 121900) by tombert on 2011-01-20 03:32:24:
- icomment:
Well yes ... it's not so easy to trace ... in the original I don't have this panic - only the unhandled exception pointing to non-existing memory. Next thing: the crash happens only when having so many public methods - if I do the test with only one method inside the class I can't reproduce. I only can do assumptions here from my experience: When I send synchronous commands to the thread I get the exceptions propagated to the calling thread, but what happens if I do it -async? Where is the error gone or how can I check if an error happens? - lacking this method I would assume the error message should be "lost" - thus why the need for so much memory? thx
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [feff6daf96] (rid 108684) by tombert on 2011-05-13 22:22:07:
- icomment:
I would like to bump this up since it is already the second thread related crash I discovered: https://sourceforge.net/tracker/index.php?func=detail&aid=3301634&group_id=10894&atid=110894 thx
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [75351288c1] (rid 105352) by tombert on 2012-04-10 16:06:05:
- foundin changed to: "obsolete: 8.5.11"
- icomment:
retested - still valid in 8.5.11
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
Ticket change [37aad3b747] (rid 112066) by sebres on 2012-04-10 21:44:02:
- icomment:
reproduced with WinXP, thread2.7, thread2.6.7, Itcl3.4 seems to be Itcl bug (cause the same with namespace does not produce exception) : >>> SUCCESS >>> package re Thread ## init ------ set ::tid [thread::create { #proc _out_err {args} {puts $args}; #thread::errorproc _out_err; thread::wait }] ## crash ------ proc thread_procCrash {args} { thread::send -async $::tid {testnamespace::unkowncommand} } ## do test ------ proc dotest {} { thread::send -async $::tid {namespace eval testnamespace {}} for {set index 0} {$index < 100000} {incr index} {thread_procCrash} } ## do test ------ dotest <<< <<< >>> BOOM >>> package re Thread ## init ------ set ::tid [thread::create { #proc _out_err {args} {puts $args}; #thread::errorproc _out_err; thread::wait }] ## crash ------ proc thread_procCrash {args} { thread::send -async $::tid {testObj unkowncommand} } ## do test ------ proc dotest {} { thread::send -async $::tid { package require Itcl itcl::class TestClass {} TestClass testObj } for {set index 0} {$index < 100000} {incr index} {thread_procCrash} } ## do test ------ dotest <<< <<< - login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [4417ce5808] (rid 116658) by sebres on 2012-04-10 22:36:03:
- icomment:
I could not more reproduce esception with current itcl-3-branch from fossil (3.4.1) - but currently i have my own customized fork only. Already fixed? Could you please test it with 3.4.1 in your environment? If not yet - I will check my fork and public a patch for this.
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [91909ee2b9] (rid 120635) by tombert on 2012-04-11 02:20:29:
- icomment:
retested in W7 still crash
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [a62d459237] (rid 98553) by tombert on 2012-04-11 02:40:58:
- icomment:
same effect with itcl-3-branch (HEAD) and itcl-3-4-1 - only a single line in a single file changed.
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [5d61be2710] (rid 115451) by tombert on 2012-04-11 02:53:05:
- icomment:
updated TCL and TK head - still crash. Note: I'am using "wish" to run the test.
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Add attachment "itcl34.dll" [27a2be3c4f] (rid 88552) by sebres on 2012-04-11 13:46:03.
Ticket change [f75f6a0400] (rid 91370) by sebres on 2012-04-11 13:46:04:
- icomment:
File Added - 440847: itcl34.dll
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [b9d689b435] (rid 129218) by sebres on 2012-04-11 13:47:32:
- icomment:
I had uploaded my itcl34.dll (32 bit), could you reproduce it within?
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [fba2ecdc3f] (rid 92098) by tombert on 2012-04-11 16:16:51:
- icomment:
Tried ~50 times with no crash.
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [c5da3faa8f] (rid 121654) by sebres on 2012-04-11 17:15:41:
- icomment:
I can not find quickly the fix for this only (have too much changes relative main stream). I made the patch included 70% of my fork code (attached). I had not yet tested this patch. In addition you have new function "itcl::struct <class> <objname>" that allow you to create an object without call of class constructors - I use this for unserialize purposes. But caution - my completelly fork does not pass some Itcl tests (I don't know about this 70%-patch).
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Add attachment "sebres-3.4-patch3.patch" [78ea9f9cc6] (rid 90040) by sebres on 2012-04-11 17:16:40.
Ticket change [a119c5898a] (rid 109665) by sebres on 2012-04-11 17:16:40:
- icomment:
File Added - 440866: sebres-3.4-patch3.patch
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [754de26cf4] (rid 105367) by sebres on 2012-04-11 17:20:23:
- icomment:
this should be moved to [incr Tcl] bug tracker...
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [c09dfb7ddf] (rid 102436) by tombert on 2012-04-11 20:05:49:
- icomment:
Added new tracker: https://sourceforge.net/tracker/?func=detail&aid=3516841&group_id=13244&atid=113244
- login: "tombert"
- mimetype: "text/plain"
- username: "tombert"
- icomment:
Ticket change [faaf23ea62] (rid 160142) by sebres on 2018-01-10 21:01:18:
- assignee changed to: "aku"
- closedate changed to: "2458129.37590385"
- closer changed to: "sebres"
- comment changed to:
I run into this from a "bigger" application where I did call an unknown method from an itcl object - doing this several times the application crashes with an unhandled exception. The small example I posted below brings up an "unable to realloc xxxxx bytes" before but then crashes in the same manner. So I assume it's something with the error propagation between the threads ... How to reproduce: source the two procedures and call dotest from the console several times - sometimes it crashes on first call, sometimes I need to call it three times. Environment used: Windows XP, TCL 8.5.9, Thread 2.6.7, Itcl 3.4 proc thread_procCrash {args} { thread::send -async $::tid [concat testObj unkowncommand] } proc dotest {} { package re Thread set ::tid [thread::create {thread::wait}] ## create initial shared variables puts $::tid foreach package {Itcl} {thread::send $::tid [list package require $package]} foreach import {itcl::*} {thread::send $::tid [list namespace import $import]} thread::send $::tid {class TestClass { public method z {} {expr 1+1} public method a {} {expr 1+1} public method b {} {expr 1+1} public method c {} {expr 1+1} public method d {} {expr 1+1} public method e {} {expr 1+1} public method f {} {expr 1+1} public method g {} {expr 1+1} public method h {} {expr 1+1} public method i {} {expr 1+1} public method j {} {expr 1+1} public method k {} {expr 1+1} public method l {} {expr 1+1} public method m {} {expr 1+1} public method n {} {expr 1+1} public method o {} {expr 1+1} public method p {} {expr 1+1} public method q {} {expr 1+1} public method r {} {expr 1+1} public method s {} {expr 1+1} public method t {} {expr 1+1} public method u {} {expr 1+1} public method v {} {expr 1+1} public method w {} {expr 1+1} public method x {} {expr 1+1} public method y {} {expr 1+1} public variable hello {}} } thread::send $::tid {TestClass testObj} for {set index 0} {$index < 100000} {incr index} {thread_procCrash} } thx for your support - icomment:
Seems to be itcl-issue (possible solved with suggested patch), so I close it here.
- login: "sebres"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- severity changed to: "Minor"
- status changed to: "Closed"