c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Failed to map a virtual memory block

Open tlodej opened this issue 1 year ago • 9 comments

This issue occured on Alpine linux which uses Musl, on x86

⚠ The compiler encountered an unexpected error: "Failed to map a virtual memory block.".

  • Function: mmap_init(...)
  • Source file: v0.7.4/c3c-0.7.4/src/utils/vmem.c:46

tlodej avatar Aug 03 '25 19:08 tlodej

32 or 64 bit?

lerno avatar Aug 03 '25 19:08 lerno

32bit

tlodej avatar Aug 03 '25 19:08 tlodej

mmap_init gets called with hardcoded 4096 * 1024 * 1024 bytes which overflows to 0

tlodej avatar Aug 03 '25 20:08 tlodej

I see.

lerno avatar Aug 03 '25 20:08 lerno

I also had to modify std library to use allocator:new_aligned instead of allocator::new in object.c3 to get it to compile a program. Is i686 architecture supported? I assumed that it is the same as x86.

tlodej avatar Aug 03 '25 20:08 tlodej

On 0.7.5 this should now be adjusted down and should work.

lerno avatar Aug 03 '25 20:08 lerno

For Linux both x86 and x64 should be supported. Windows 32 bit isn't.

lerno avatar Aug 03 '25 21:08 lerno

Is this verified to work now?

lerno avatar Sep 30 '25 21:09 lerno

I'm going to assume it is.

lerno avatar Oct 10 '25 18:10 lerno