View Issue Details

IDProjectCategoryView StatusLast Update
0020452FPCRTLpublic2011-10-10 14:06
ReporterPeter Popov Assigned ToJonas Maebe  
Status resolvedResolutionno change required 
Product Version2.4.4 
Summary0020452: CBeginThread in cthreads.pp fails with default stack size
DescriptionApparently the stack size for a new thread on my machine is less than what CBeginThread is being called with. As a result, CBeginThread fails leading to EThread error.

The current implementation of CBeginThread will fail if pthread_attr_setstacksize fails. This should probably be changed.
Steps To ReproduceYou need a machine with sufficiently small max pthread stack size (2M in my case).
TagsNo tags attached.
Fixed in Revision
Attached Files


Jonas Maebe

2011-10-10 14:06

manager   ~0052829

The TThread.Create() constructor has an optional parameter that allows you to specify the stack size:

The constructor should return an error if the requested stack size cannot be allocated, because otherwise the caller will expect that stack size to be available. If less stack is required by the caller, it can specify this using the tthread.create() constructor as described above.

The default will not be changed, as it corresponds to the default stack thread stack size used on most platforms nowadays (in case you don't specify an explicit stack size attribute to pthread_create).

Issue History

Date Modified Username Field Change
2011-10-10 13:32 Peter Popov New Issue
2011-10-10 14:06 Jonas Maebe Status new => resolved
2011-10-10 14:06 Jonas Maebe Resolution open => no change required
2011-10-10 14:06 Jonas Maebe Assigned To => Jonas Maebe
2011-10-10 14:06 Jonas Maebe Note Added: 0052829