[llvm-bugs] [Bug 37181] New: wasm32: Allow placing the stack before global data

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 19 14:36:35 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37181

            Bug ID: 37181
           Summary: wasm32: Allow placing the stack before global data
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: dan433584 at gmail.com, llvm-bugs at lists.llvm.org,
                    sbc at chromium.org

We've been having some discussions in Rust about the memory layout of wasm
modules (https://github.com/rust-lang-nursery/rust-wasm/issues/81) and one
thing we're wondering is how to best catch stack overflow
(https://github.com/rust-lang-nursery/rust-wasm/issues/141). Currently a stack
overflow will silently corrupt static data unfortunately and can be difficult
to diagnose, and the default stack size is 64 kilobytes which is a pretty
small! (it's our own issue though we should tweak that by default).

Would it be possible to have an option in LLD to place the stack before global
data? That way the stack could never corrupt global data and stack overflow
would always result in running below the address 0, almost guaranteed to be out
of bounds.

I'm not sure if this would be a great default to enable, but being able to
tweak this for experimentation might also be good to have!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180419/b6d94535/attachment.html>


More information about the llvm-bugs mailing list