Overview
| Artifact ID: | d2efd5b5fc4e00d86c31d07bbff8dd7478c0e925 |
|---|---|
| Ticket: | 1865728fffffffffffffffffffffffffffffffff
stack checking code isn't functional |
| User & Date: | msofer on 2008-01-07 16:51:13 |
Changes
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Originator: NO Please provide platform details, what you mean by "nothing is working because of running in a loop", and as much debugging help as possible. Do you get an infinite loop? A segfault? An error? Any message? Can you provide a script that shows the behaviour? A simple one is better than a big one ;) ---- The code is *not* "comparing a pointer returned from malloc with an address from a variable in the current stack". What is compared is a pointer to a variable in the current stack (&localint) to an address determined to be "the stack limit" for the current interp (iPtr->stackBound). This limit is determined in Unix as an address in the stack plus/minus (the stack size minus a safety buffer): an address in the stack not in the heap. The stack size itself is determined by the pthread library, except for the initial stack where it is determined by rlimit. See TclpGetCStackParams() and GetStackSize() in tclUnixInit.c, TclpThreadGetStackSize in tclUnixThrd.c. The code does work with threads, assuming the pthread library is doing its thing. As far as we know, modulo [Bug 1850424] referred to by the previous comment. Address randomization might however be an issue? Please provide details. Note that the code will possibly fail if your (C, not script) code: - has the main Tcl interp in a thread which is not the initial thread - a thread's stack size is changed after the first call to a Tcl command in it. On this please see the comments in TclpThreadGetStackSize(). Note that neither tclsh nor the thread extension do any of this.
- login: "msofer"
- mimetype: "text/plain"
- subsystem changed to: "41. Memory Allocation"
- username: "msofer"