Skip to content

Default stack size Mono vs CoreCLR #124368

@tmds

Description

@tmds

I debugged a crash of vmr which occurred while building fsharp repo on s390x. Looking at the crash, the stack had overflowed.

I had not seen such an overflow on x64/arm64 (using CoreCLR). Looking closer at the implementation, with CoreCLR, the stack size follows the Linux configured limit (ulimit -s, typically 8MB), while for Mono it is hard-coded to 2MB (on 64-bit, and 1MB on 32-bit):

set_stack_size = (SIZEOF_VOID_P / 4) * 1024 * 1024;

When I changed the hard-coded size to 8MB on Mono, the stack overflow crash no longer occurred.

This issue is for changing the stack size on Mono so it matches with what CoreCLR does (in a similar environment).

cc @jkotas @akoeplinger @omajid

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions