.
D 2007-02-07T12:46:56
J assignee hobbs
J cmimetype text/plain
J comment on\sx86_64\skernel,\s32-bit\smock\sroot,\spthread_getattr_np\sreturns\sin\sthe\sinitial\sthread\show\smuch\sthe\sstack\scan\sactually\sgrow\sat\sthat\spoint,\sif\sI\stry\ssay:\nextern\sint\sTclpThreadGetStackSize(void);\sint\smain\s(void)\s{\s__builtin_printf\n("%x\\n",\sTclpThreadGetStackSize\s());\s}\nlinked\sagainst\s-ltcl8.5\sit\sprints\saa650000\n\nTclpThreadGetStackSize\sit\smust\sreturn\ssize_t\n\nTclpCheckStackSpace\s\nif\s(tsdPtr->initialised\s==\s0)\swe\sdidn't\scompute\sstack\ssize\sbefore.\sBut,\swhen\sGetStackSize\swas\scomputed\susing\spthread_getattr_np\srather\sthan\ssay\sgetrlimit\sthis\s\sassumption\sis\swrong\sfor\sthe\sinitial\sthread.\s\sThere\npthread_getattr_np\schanges\sover\stime,\sas\smemory\sis\smmapped/unmapped,\swith\sRLIMIT_STACK\sbeing\sthe\supper\slimit\sfor\sit.\n\nTclpCheckStackSpace\sptrdiff_t\sis\sa\ssigned\stype\sand\sif\stsdPtr->stackSize\sis\sbigger\sthan\shalf\sof\sthe\saddress\sspace.\sFor\sLinux\sand\smost\sother\stargets\sptrdiff_t\sis\sthe\ssame\ssize\sas\ssize_t,\sonly\nsize_t\sis\sunsigned,\sso\sguess\sjust\n-\s\s\s\sif\s(stackUsed\s<\s(ptrdiff_t)\stsdPtr->stackSize)\s{\n+\s\s\s\sif\s((size_t)\sstackUsed\s<\stsdPtr->stackSize)\s{\nand\sa\sfix\sfor\sTclpThreadGetStackSize\sreturn\svalue\scould\sbe\senough.\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter mmaslano
J subsystem 41.\sMemory\sAllocation
J title broken\sstack\schecking\scode
J type Patch
K 1654104fffffffffffffffffffffffffffffffff
U mmaslano
Z 7a40e9374edc9ce352bb9eec37f77bb1