Skip to content
Tcl Source Code History Of Ticket 1909647fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1909647fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1909647fffffffffffffffffffffffffffffffff

  1. Ticket change [b9b1c8c6eb] (rid 129194) by ctasada on 2008-03-07 15:47:44:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hi guys,
      
      We're using ActiveTcl 8.5.1, bytecoded with tbcload1.7. From time to time, the application crashes with a "TclStackFree: incorrect freePtr. Call out of sequence?", but so far this happens only in Linux.
      
      We're using threads and sockets actively and usually the crash appears just after a "puts" in a file or after a socket is closed.
      
      I don't even known how to start debugging the problem.
      
      I've been looking into Tcl sourcecode and the first think that I see regarding the use of TclStackFree is that it's used in the Linux version of TclpCreateProcess, but not in Windows. Following this lead I finished in the Tcl_OpenCommandChannel, the one used to process the tcl exec command.
      
      Am I in drunks o could be that some error or wrongly synched command in the Tcl_OpenCommandChannel could be producing this problem?
      
      Any help is more than welcome.
      
      Cheers,
      Carlos
      
    4. foundin initialized to: "obsolete: 8.5.1"
    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: "ctasada"
    10. subsystem initialized to: "69. Other"
    11. title initialized to:
      TclStackFree: incorrect freePtr. Call out of sequence?
      
    12. type initialized to: "Bug"
  2. Ticket change [3ebe90b567] (rid 121324) by dkf on 2008-03-11 19:18:38:

    1. assignee changed to: "msofer"
  3. Ticket change [cf60345f28] (rid 112965) by msofer on 2008-03-11 19:48:22:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      This definitely looks like a threading problem: wrong timing within the same thread will cause TclStackFree to bomb reliably.
      
      First let us try to reduce the problem a bit:
      
      (1) tbcload should have nothing to do with this; can you confirm by using the script sources instead of the precompiled version? I do not know if you have them available or not, it might be 3rd party code
      
      (2) You are using threads: script or C api? If C: are you respecting Tcl's threading model, "no calls to an interp from a different thread"? 
      
      (3) Can you reduce the problem to some smallish demo that we can study?
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [e22a98be48] (rid 87577) by ctasada on 2008-03-11 20:14:56:

    1. icomment:
      Logged In: YES 
      user_id=340696
      Originator: YES
      
      Hi Miguel,
      
      What do you mean by "wrong timing"? Some "after"? or maybe some async thread that's released too early? Can the problem be related with some "exec" command as I said before?
      
      Regarding you questions
      
      1) I already though about that. I doing some changes in the sourcecode and I have a client that volunteer to test it running from source. Hope I'll have something new in a couple of days.
      
      2) I'm using threads from scripts.
      
      3) That's the bad part. I'm trying to find how to simplify the problem as much as possible to have a nice test case. Anyway seems that's related with some other problem that's leaking memory (I'm looking into that right now). At the moment that I "puts" to a file, seems that the used memory is too much and the application crashes.
      
      Best Regards,
      Carlos Tasada.
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. username: "ctasada"
  5. Ticket change [26e2d2adbf] (rid 88425) by msofer on 2008-03-11 20:30:33:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      On the timing issue: TclStackAlloc/TclStackFree is a very specialised internal allocator, it reserves memory in Tcl's internal stack. It is of the utmost importance for its proper functioning that frees occur in the precise reverse sequence of allocs (*), or else get a panic. What you are seeing is a violation of this timing principle.
      
      Had this happened in a single thread, the crash would be deterministic - an obvious bug with a slim chance of making it past the testing phase. However, if different threads are allocing/freeing from the same interp's stack (shouldn't happen as the stack is interp-specific), thread coordination issues could cause the observed behaviour. This is what I suspect. Not much of a clue beyond that yet.
      
      (*) They should also be precisely coordinated with the bytecode engine's own usage of the stack. This is an internal allocator that is not meant to be used by extensions.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  6. Ticket change [d5b25340fc] (rid 123670) by msofer on 2008-06-28 20:43:54:

    1. closedate changed to: "2008-06-28T13:43:54"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      Submitter went AWOL? I'm still suspecting a violation of Tcl's threading model. 
      
      In order to do anything about this I would need more info.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Pending"
    7. username: "msofer"
  7. Ticket change [f61a45e650] (rid 130233) by ctasada on 2008-06-30 15:17:34:

    1. icomment:
      Logged In: YES 
      user_id=340696
      Originator: YES
      
      Hi Miguel,
      
      What more info do you need? My main problem is that I cannot replicate the problem in an easy way. But I found some extra info about that. We've the same code running in 32 and 64 bits and seems that the problem happens more frequently in 64b. Anyway just ask me what more info do you need and I'll do anything on my side to send it to you.
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "ctasada"
  8. Ticket change [a67379015c] (rid 98600) by msofer on 2008-07-21 11:49:36:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      Sorry this flew under my radar. More info: ideally a smallish example to repro. But at least
      (a) assurance that the threading model is respected: each interp is only called from the thread where it was created
      (b) a stack trace 
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  9. Ticket change [188c07f5a6] (rid 122680) by ctasada on 2008-07-21 14:40:12:

    1. icomment:
      Logged In: YES 
      user_id=340696
      Originator: YES
      
      Hi Miguel,
      
      I'll do my best to send you more info this week.
      
      Best Regards,
      Carlos.
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. username: "ctasada"
  10. Ticket change [3be12fd45f] (rid 112824) by msofer on 2008-07-30 06:53:19:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      One thing that comes to mind is #2030670. A fix was committed today to both HEAD and the 8.5 branch, that patch can be applied as is.
      
      Hmmm ... I now notice that it is under 8.5.1. The very first thing to do is to test with a more recent version, that could well be a something that's already fixed. However, if it is #2030670 no version containing the patch has yet been released.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  11. Ticket change [445d0cf552] (rid 116698) by ctasada on 2008-07-30 14:34:46:

    1. icomment:
      Logged In: YES 
      user_id=340696
      Originator: YES
      
      Yes, I saw the patch and also though that could be related :)
      
      Thinks have been crazy here the last weeks, anyway as soon as 8.5.4 is released I'll give it a try :)
      
      Can we leave this bug in standby until then?
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. username: "ctasada"
  12. Ticket change [111b2ebc37] (rid 95084) by ctasada on 2008-12-11 16:16:47:

    1. icomment:
      Hi Miguel,
      
      Well it took me almost 6 months to come back to you (I'm ashamed). We upgraded to 8.5.4 2 months ago, and seemed that everything was fine, but last week I found the same problem again. This time our customer is running a "CentOS release 5.2 (Final) (2.6.18-92.1.13.el5xen) (x86_64 64 bits)"
      
      In a previous email you asked for 2 thinks: 
      
      a) be sure that the thread model is respected
      
      I'm reasonably sure that everything is fine there. But we do, of course, some chitchatting between threads to send and get back results.
      
      b) Stacktrace
      
      How can I do that? Do I need some special Tcl build? (I'm using ActiveTcl 8.5.4)
      
      I'm still without good replication steps. It simply happens so I'm not really sure how to attack it.
      
      Best Regards,
      Carlos.
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. username: "ctasada"
  13. Ticket change [88e3a24e80] (rid 131934) by ctasada on 2009-01-19 18:46:02:

    1. foundin changed to: "obsolete: 8.5.4"
    2. icomment:
      Hi Miguel,
      
      Bug appeared again in another machine. And seems to happen with some frequency, so maybe I´ll be able to debug there.
      
      Any tip about how to do it?
      
      
    3. login: "ctasada"
    4. mimetype: "text/plain"
    5. priority changed to: "4"
    6. username: "ctasada"
  14. Ticket change [7e558fecea] (rid 97395) by msofer on 2009-05-10 10:09:14:

    1. icomment:
      Still happening with newer releases?
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  15. Ticket change [04b90f7431] (rid 88923) by msofer on 2009-05-10 10:09:15:

    1. closedate changed to: "2009-05-10T03:09:15"
    2. closer changed to: "msofer"
    3. status changed to: "Pending"
  16. Ticket change [90dfa00a4c] (rid 120530) by ctasada on 2009-05-12 14:45:51:

    1. icomment:
      Do you mean in the 8.5.7 or in 8.6?
      
      Anyway I haven't seen any crash since January using 8.5.4, but also, as you known, I cannot replicate it easily.
      
      On the other hand I've seen that using linux kernel 2.6.27 I've tons of crashes using threads, but I don't known if it's related or not with this case.
      
      I'll try to create an script to replicate it, but I cannot promise anything in a short time :(
      
      Thanks.
      
      
      
      
    2. login: "ctasada"
    3. mimetype: "text/plain"
    4. username: "ctasada"
  17. Ticket change [0236a774b7] (rid 119607) by ctasada on 2009-05-12 14:45:52:

    1. status changed to: "Open"
  18. Ticket change [1cdad19dd9] (rid 90686) by msofer on 2009-12-11 10:31:06:

    1. closedate changed to: "2009-12-11T03:31:06"
    2. closer changed to: "msofer"
    3. status changed to: "Pending"
  19. Ticket change [907f5d5273] (rid 120459) by sf-robot on 2009-12-26 09:20:32:

    1. closedate changed to: "2009-12-26T02:20:32"
    2. closer changed to: "sf-robot"
    3. icomment:
      
      
      allow_comments - 1
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"