Microsoft KB Archive/70262

= FIX: Invalid Executable File, 65,535 Byte Stack Size Requested =

Article ID: 70262

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft LINK for MS-DOS 3.x
 * Microsoft LINK for MS-DOS 4.x
 * Microsoft LINK for MS-DOS 5.0x
 * Microsoft LINK for MS-DOS 5.1x
 * Microsoft LINK for MS-DOS 5.2
 * Microsoft LINK for OS/2 5.0x
 * Microsoft LINK for OS/2 5.1
 * Microsoft LINK for OS/2 5.11
 * Microsoft LINK for OS/2 5.13
 * Microsoft LINK for OS/2 5.15

-



This article was previously published under Q70262



SYMPTOMS
An attempt to run an executable file fails and the computer hangs, the program gives unexpected results, or generates the following message:

run-time error R6000

- stack overflow



CAUSE
The application specifies a stack size of exactly 65,535 bytes. When the Microsoft LINK /STACK option specifies 65,535 bytes (or the Microsoft language compiler /F option specifies FFFFh bytes), the linker does not display a warning message and it sets the stack size to zero bytes. The error occurs because LINK rounds an odd stack size to the next larger even value in an effort to create the most efficient executable file.



RESOLUTION
To request the largest possible stack size, specify 65,534 in the /STACK linker option (or /F compiler option).

Microsoft has confirmed this to be a problem in LINK versions listed above. LINK versions 5.3 and higher (16-bit versions) generate an error if the user specifies a stack size larger than 65,534 (64K - 2).

Additional query words: 3.65 3.69 4.06 4.07 4.10 5.01.20 5.01.21 5.02 5.03 5.05 5.10 5.11 5.13 5.15 5.20

Keywords: kbfix kb16bitonly KB70262

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.