metaeducation / rebol-issues

6 stars 1 forks source link

Raise stack size for Win32 binaries built from the hostkit #1732

Open rebolbot opened 14 years ago

rebolbot commented 14 years ago

Submitted by: abolka

Win32 binaries built from the hostkit should use the same stack size as the Win32 binaries built by RT. Currently, the hostkit binaries use a smaller stack than the RT binaries, which leads to a bunch of stack overflow crashes: #877, #1665, and #1672.

Carl mentions in the comments to #1672 that "If you set [the C runtime stack] to 5MB that will work, but the correct solution is to find a way for REBOL to detect the max stack size."

Until that correct solution is in place, the hostkit builds should use the same stack size as the RT builds to try and avoid this class of errors.

CC - Data [ Version: alpha 109 Type: Bug Platform: Windows Category: Host-Kit Reproduce: Always Fixed-in:r3 master ]

rebolbot commented 13 years ago

Submitted by: abolka

Reposting part of my comment to #1672, which hints at the solution:

On Win32, the default stack size is a property of the PE binary. By default it is set to 1MB. To raise this limit using GCC/Binutils, use the -Wl,--stack flag when linking. So -Wl,--stack,5242880 will set the stack size to 5MB. (For current hostkits, edit make-gcc/makefile and append this flag to the LIBS variable.)

Current RT-built binaries use a stack size of 4194300 bytes.

rebolbot commented 13 years ago

Submitted by: Carl

In A110 the OS_Config() function has been added to the host-lib. It can be used to tell the REBOL lib the stack size of the process. If a zero is passed the default stack size is used (4194300).

rebolbot commented 13 years ago

Submitted by: abolka

Very nice!

rebolbot commented 11 years ago

Submitted by: abolka

Fixed in 8dc20083a40101bf0062a69d723fd702b5f98f60 which was merged in b212f8c2c0023f8b383c4eb131cdfb22db678a3b.