Skip to content

Crash when the memory on host is insufficient #448

@tony2037

Description

@tony2037

I was testing on multipass (a lightweight VM manager for Linux, Windows and macOS).
The VM was running on a MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports), the configuration was as follows:

<Host>
Processors: 2.3 GHz Dual-Core Intel Core i5
Memory: 8 GB 2133 MHz LPDDR3
<VM>
Distribution: multipass
local cpu: 4
local memory: 4.0GiB
$ free -h
               total        used        free      shared  buff/cache   available
Mem:           3.8Gi       212Mi       2.1Gi       0.0Ki       1.5Gi       3.3Gi
Swap:             0B          0B          0B

I was testing hello.elf, but this problem happened to all the other binaries.
The steps to reproduce are as follows:

$> ./build/rv32emu ./build/hello.elf
rv32emu: src/riscv.c:199: rv_create: Assertion `attr->mem' failed.
Aborted (core dumped)

The core file is as follows.
coredump.zip

By conducting the postmortem analysis, I realized it was because I did not have sufficient memory for mmap, and the MEM_SIZE is hard-coded to 2^32 - 1 (4GB).

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions