Artifacts Associated With Ticket 450795ffffffffffffffffffffffffffffffffff
Ticket change [4c62c78ec2] (rid 126886) by msofer on 2001-08-14 14:01:42:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
TclpCheckStackSpace() (in unix/tclUnixInit.c) should be implemented for unix - it is already implemented for both Mac and Win. It's role is to prevent C-stack overflow, producing an error instead of who knows what.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: ""
- title initialized to: "implement TclpCheckStackSpace() for unix"
- type initialized to: "Patch"
Add attachment "stackSpace.patch.gz" [1e2b3301f1] (rid 90933) by msofer on 2002-02-26 00:37:30.
Ticket change [7e42e45f89] (rid 97381) by msofer on 2002-02-26 00:37:30:
- assignee changed to: "msofer"
- icomment:
File Added - 18399: stackSpace.patch.gz Logged In: YES user_id=148712 I attach a patch (gzipped) that implements TclpCheckStackSpace. Please test it on different unixen - it runs ok with gcc (egcs-2.91.66, glibc 2.1.3) on linux/intel. Some comments: 1. in order to use, the new function TclpInitCheckStackSpace (tclUnixInit.c) should be called with a stack address as early as possible. In the patch, this is done from Tcl_Main so that the writers of special shells do not have to worry about it. 2. as it is here, the functionality is not available for embedders - the new function is not declared in the stubs tables. If the functionality is deemed necessary, it may be worth considering making it public (or called from some new Tcl_InitializeSystem). That would require TIPping. 3. if TclpInitCheckStackSpace is never called, the behaviour is the same as without the patch: it is always assumed that there is enough stack space to continue. Comments welcome!
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [e4d7f3817f] (rid 88029) by msofer on 2002-02-26 00:38:31:
- assignee changed to: "nobody"
- subsystem changed to: "None"
Ticket change [d2e196538e] (rid 113604) by msofer on 2002-02-26 00:42:11:
- assignee changed to: "msofer"
Ticket change [6b75a326ba] (rid 128335) by dkf on 2002-02-26 20:57:33:
- icomment:
Logged In: YES user_id=79902 Looks mostly good to me, both with GCC and with SunPro CC on Solaris/SPARC, except for the configure script which ought to print out more of what it is doing with your stackspace check as well as cacheing the values concerned. Luckily, this is easy to add - see the extra patch which I supply which should be applied *after* yours. The other minor quibble I've noticed (from using SunPro CC) is that you shouldn't do #undef TclpCheckStackSpace() but rather just #undef TclpCheckStackSpace (SunPro CC is great, because it moans about completely different things to GCC. :^)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "configure.patch" [792844340f] (rid 90083) by dkf on 2002-02-26 20:57:34.
Ticket change [abacd0a2c7] (rid 101157) by dkf on 2002-02-26 20:57:39:
- icomment:
File Added - 18461: configure.patch
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [6b002961a0] (rid 128244) by msofer on 2002-02-26 22:22:46:
- icomment:
Logged In: YES user_id=148712 Improved stackSpace2.patch: * corrections as suggested by Donal * more checks and default behaviour in tclUnixInit.c
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [44fc7cdc0b] (rid 116803) by msofer on 2002-02-26 22:22:47:
- icomment:
File Added - 18464: stackSpace2.patch.gz
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [79b7c523cb] (rid 90179) by msofer on 2002-02-26 22:52:19:
- icomment:
File Deleted - 18464: Logged In: YES user_id=148712 Aargh! Removing patch2 2 (typos); back in a few minutes!
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [1d5252b3b3] (rid 90784) by msofer on 2002-02-26 22:56:54:
- icomment:
Logged In: YES user_id=148712 OKnow ...
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "stackSpace2.patch.gz" [768563674c] (rid 105604) by msofer on 2002-02-26 22:56:54.
Ticket change [8a22192604] (rid 127343) by msofer on 2002-02-26 22:56:55:
- icomment:
File Added - 18465: stackSpace2.patch.gz
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [3650ab36bc] (rid 107088) by msofer on 2002-02-27 21:50:45:
- icomment:
Logged In: YES user_id=148712 Note that this patch implements a "light" TclpCheckStackSpace: it monitors the remaining stack space with respect to the maximum allowed by the OS, but *not* against stack-heap collisions. The win implementation (and presumably the mac too) monitor both. Joe English has proposed a solution for linux/gcc in non-threaded builds that monitors the stack-heap distance "as long as you haven't called mmap()/shmget/whatever (not sure how that affects the memory map)". It is done by setting the condition to monitor to ((&here > tclMinCStackPos) && (&here > sbrk(0) + tclMinCStackSize))
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [bdb62b7216] (rid 101949) by msofer on 2002-02-28 00:33:35:
- icomment:
File Added - 18530: stackSpace3.patch.gz Logged In: YES user_id=148712 New "production-ready" stackSpace3.patch, for review. It is still missing the adaptation to threaded builds; as before, it does not guard against stack-heap collisions.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "stackSpace3.patch.gz" [ba4c3aedba] (rid 129298) by msofer on 2002-02-28 00:33:35.
Ticket change [664f4c79c1] (rid 102688) by hobbs on 2003-11-12 07:11:16:
- closedate changed to: "2003-11-12T00:11:16"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 dup of 746378 - we should compare the differences between these two approaches.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Duplicate"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [5d84ca04bf] (rid 115475) by msofer on 2003-11-12 08:27:55:
- icomment:
Logged In: YES user_id=148712 IIUC, 746378 started on this approach and improved it a lot - in particular, making it work also for threaded builds. If that is correct, this patch is superceded by 746378.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [099f029f55] (rid 113689) by dkf on 2003-11-12 22:58:03:
- subsystem changed to: "38. Init - Library - Autoload"