INTERNAL: % Internal threading error: Unable to create thread
Topic:
A customer reported the following error message when starting IDL on his Linux system.
idl
IDL Version 6.0 (linux x86 m32). (c) 2003, Research Systems, Inc.
% Internal threading error: Unable to create thread (IDL_ThreadCreate() calling pthread_create()).
Invalid argument
Discussion:
This error message is caused by the stacksize limit being set to high. The problem is that each thread that is created will try and allocate it's own private stack using the default stacksize. If the default stacksize limit is set too high then the system can run out of memory and simply refuse to create new threads.
This error can be reproduced on our RedHat 9 test machine (rh9-pod). For example:
rh9-pod:~/NETHOME> limit stacksize 3000000
rh9-pod:~/NETHOME> idl
IDL Version 6.0 (linux x86 m32). (c) 2003, Research Systems, Inc.
Installation number: 99999-1.
Licensed for use by: RSI IDL floating licenses
% Internal threading error: Unable to create thread (IDL_ThreadCreate() calling pthread_create()).
Cannot allocate memory
Note that the stack size limit is set to 3GB in this case. This causes a problem because of the 32-bit memory space available on Linux.
A solution is to lower the stack size to something more reasonable:
rh9-pod:~/NETHOME> limit stacksize 8192
rh9-pod:~/NETHOME> idl
IDL Version 6.0 (linux x86 m32). (c) 2003, Research Systems, Inc.
Installation number: 99999-1.
Licensed for use by: RSI IDL floating licenses
To print the current limits on a unix system use:
limit
Or for bash (bash, sh, ksh) shell users the commands are:
ulimit -s
ulimit -s 8192
This will print the current stacksize limit and the second command will change the limit to 8192 kB.Solution:
[Edit this field in the IDL-based Tech Tip Editor, v60]