Artifacts Associated With Ticket 1654104
Ticket change [69acc88f0b] (rid 103290) by mmaslano on 2007-02-07 12:46:56:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
on x86_64 kernel, 32-bit mock root, pthread_getattr_np returns in the initial thread how much the stack can actually grow at that point, if I try say: extern int TclpThreadGetStackSize(void); int main (void) { __builtin_printf ("%x\n", TclpThreadGetStackSize ()); } linked against -ltcl8.5 it prints aa650000 TclpThreadGetStackSize it must return size_t TclpCheckStackSpace if (tsdPtr->initialised == 0) we didn't compute stack size before. But, when GetStackSize was computed using pthread_getattr_np rather than say getrlimit this assumption is wrong for the initial thread. There pthread_getattr_np changes over time, as memory is mmapped/unmapped, with RLIMIT_STACK being the upper limit for it. TclpCheckStackSpace ptrdiff_t is a signed type and if tsdPtr->stackSize is bigger than half of the address space. For Linux and most other targets ptrdiff_t is the same size as size_t, only size_t is unsigned, so guess just - if (stackUsed < (ptrdiff_t) tsdPtr->stackSize) { + if ((size_t) stackUsed < tsdPtr->stackSize) { and a fix for TclpThreadGetStackSize return value could be enough. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mmaslano"
- subsystem initialized to: "41. Memory Allocation"
- title initialized to: "broken stack checking code"
- type initialized to: "Patch"
Ticket change [7356678422] (rid 105032) by mmaslano on 2007-02-07 19:46:56:
- icomment:
File Added - 214873: tcl-8.5a5-stackchk.patch
- login: "mmaslano"
- mimetype: "text/plain"
- username: "mmaslano"
- icomment:
Add attachment "tcl-8.5a5-stackchk.patch" [c69a9f4d06] (rid 121799) by mmaslano on 2007-02-07 19:46:56.
Ticket change [33c73d0922] (rid 106651) by hobbs on 2007-02-09 06:41:12:
- closedate changed to: "2007-02-08T23:41:12"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Originator: NO Noted and corrected at about the same time. Use of size_t for stackUsed.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"