Skip to content

Stack getting overflowed when Im boxing an array #110042

Closed as not planned
Closed as not planned
@0xN1nja

Description

@0xN1nja

I tried this code:

let a=Box::new([0;10000000]);

I expected that it would allocate array on the heap but instead, it panicked : thread 'main' has overflowed its stack

Meta

rustc --version --verbose:

rustc 1.68.0 (2c8cc3432 2023-03-06)
binary: rustc
commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74
commit-date: 2023-03-06
host: x86_64-pc-windows-msvc
release: 1.68.0
LLVM version: 15.0.6
Backtrace

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\rusty-image-resizer.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions