Skip to content

wasm has a max stack size of ~66K #3735

@fengb

Description

@fengb

Easiest to reproduce with the WASI test patches:

$ zig test wasi.zig -target wasm32-wasi --test-cmd wasmtime --test-cmd-bin

const std = @import("std");

test "safe" {
    var buf: [64000]u8 = undefined;
    std.debug.warn("{*}\n", &buf);
}

test "broken in debug" {
    var buf: [65000]u8 = undefined;
    std.debug.warn("{*}\n", &buf);
}

test "broken in release-safe" {
    var buf: [66000]u8 = undefined;
    std.debug.warn("{*}\n", &buf);
}

test "broken in release-fast" {
    var buf: [68000]u8 = undefined;
    std.debug.warn("{*}\n", &buf);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasm32-bit and 64-bit WebAssemblycontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions