Skip to content
Tcl Source Code History Of Ticket 3161787
Login

History Of Ticket 3161787

Artifacts Associated With Ticket 3161787

  1. Ticket change [f1d151e680] (rid 109423) by tombert on 2011-01-19 15:34:54:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
    4. foundin initialized to: "obsolete: 8.5.9"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "tombert"
    10. subsystem initialized to: "49. Threading"
    11. title initialized to: "Unhandled exception with threaded itcl objects"
    12. type initialized to: "Bug"
  2. Ticket change [98c81c597f] (rid 110672) by msofer on 2011-01-19 22:49:54:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [c74291364f] (rid 121900) by tombert on 2011-01-20 03:32:24:

    1. 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
      
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  4. Ticket change [feff6daf96] (rid 108684) by tombert on 2011-05-13 22:22:07:

    1. 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
      
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  5. Ticket change [75351288c1] (rid 105352) by tombert on 2012-04-10 16:06:05:

    1. foundin changed to: "obsolete: 8.5.11"
    2. icomment:
      retested - still valid in 8.5.11
      
      
    3. login: "tombert"
    4. mimetype: "text/plain"
    5. username: "tombert"
  6. Ticket change [37aad3b747] (rid 112066) by sebres on 2012-04-10 21:44:02:

    1. 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
      <<< <<<
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  7. Ticket change [4417ce5808] (rid 116658) by sebres on 2012-04-10 22:36:03:

    1. 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.
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  8. Ticket change [91909ee2b9] (rid 120635) by tombert on 2012-04-11 02:20:29:

    1. icomment:
      retested in W7 still crash
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  9. Ticket change [a62d459237] (rid 98553) by tombert on 2012-04-11 02:40:58:

    1. icomment:
      same effect with itcl-3-branch (HEAD) and itcl-3-4-1 - only a single line in a single file changed.
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  10. Ticket change [5d61be2710] (rid 115451) by tombert on 2012-04-11 02:53:05:

    1. icomment:
      updated TCL and TK head - still crash.
      Note: I'am using "wish" to run the test.
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  11. Add attachment "itcl34.dll" [27a2be3c4f] (rid 88552) by sebres on 2012-04-11 13:46:03.

  12. Ticket change [f75f6a0400] (rid 91370) by sebres on 2012-04-11 13:46:04:

    1. icomment:
      
      
      File Added - 440847: itcl34.dll
      
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  13. Ticket change [b9d689b435] (rid 129218) by sebres on 2012-04-11 13:47:32:

    1. icomment:
      I had uploaded my itcl34.dll (32 bit), could you reproduce it within?
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  14. Ticket change [fba2ecdc3f] (rid 92098) by tombert on 2012-04-11 16:16:51:

    1. icomment:
      Tried ~50 times with no crash.
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  15. Ticket change [c5da3faa8f] (rid 121654) by sebres on 2012-04-11 17:15:41:

    1. 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).
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  16. Add attachment "sebres-3.4-patch3.patch" [78ea9f9cc6] (rid 90040) by sebres on 2012-04-11 17:16:40.

  17. Ticket change [a119c5898a] (rid 109665) by sebres on 2012-04-11 17:16:40:

    1. icomment:
      
      
      File Added - 440866: sebres-3.4-patch3.patch
      
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  18. Ticket change [754de26cf4] (rid 105367) by sebres on 2012-04-11 17:20:23:

    1. icomment:
      this should be moved to [incr Tcl] bug tracker...
      
      
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. username: "sebres"
  19. Ticket change [c09dfb7ddf] (rid 102436) by tombert on 2012-04-11 20:05:49:

    1. icomment:
      Added new tracker: https://sourceforge.net/tracker/?func=detail&aid=3516841&group_id=13244&atid=113244
      
      
      
    2. login: "tombert"
    3. mimetype: "text/plain"
    4. username: "tombert"
  20. Ticket change [faaf23ea62] (rid 160142) by sebres on 2018-01-10 21:01:18:

    1. assignee changed to: "aku"
    2. closedate changed to: "2458129.37590385"
    3. closer changed to: "sebres"
    4. 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
      
    5. icomment:
      Seems to be itcl-issue (possible solved with suggested patch), so I close it here.
      
    6. login: "sebres"
    7. mimetype: "text/plain"
    8. resolution changed to: "Out of Date"
    9. severity changed to: "Minor"
    10. status changed to: "Closed"