OS/2 1.1 EXE May Fail Under 1.2 Due to Small Thread Stack Size

ID Number: Q51512

5.10 6.00 6.00a

OS/2

Summary:

If a multithread program runs correctly under OS/2 version 1.1 but the

identical program fails under OS/2 version 1.2, the problem may be the

size of the thread stack. Under OS/2 1.2, a thread has more overhead

and requires more space. If you maintain the recommended 2K minimum

stack size for each thread, you should never run into this problem.

More Information:

If your program has been running successfully under OS/2 1.1 with a

thread stack that is smaller than 2K, and the program fails under OS/2

1.2, the first thing you should try is a larger thread stack size.

Some of the early examples of multithreaded programming included in

the OS/2 SDK use a thread stack size of 400 bytes. These programs run

fine on the previous versions of OS/2, but fail with a trap 000C under

OS/2 1.2. A check of the Intel 80286 documentation shows that 000C is

a stack overflow problem.

The exact increase necessary in thread stack size between OS/2 1.1 and

1.2 is not known, but increasing the stack to 1000 bytes allows these

SDK examples to run without problem. Regardless of the actual

difference needed, the best thing to do is to maintain the minimum of

at least a 2K thread stack to prevent problems in general.

Additional reference words: 1.10 1.20 5.10 6.00 6.00a