microsoft / microsoft/mimalloc

mimalloc is incompatible with musl libc on arm64 device

Open
#556 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

hi there, fellow gentoo user here.

musl is a very lean and fast alternative libc to the bloaty and unhealthy glibc. This is the projects website: https://www.musl-libc.org/ and git: https://git.musl-libc.org/cgit/musl/

mold is a new super fast linker, it can be found here: https://github.com/rui314/

I initially tested the compile of mold against mimalloc with amd64, where it works perfectly fine. On arm64, the compile is working but the resulting binary flakes immediately:

```
/usr/bin/mold -v

mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: error: unable to allocate memory (72704 bytes)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: warning: unable to allocate OS memory (67108864 bytes, error code: 12, address: 0, large only: 0, allow large: 1)
mimalloc: error: unable to allocate memory (36 bytes)
mimalloc: error: out of memory in 'new'Aborted
```

this issue was first filled here: https://github.com/rui314/mold/issues/281

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported failure with `/usr/bin/mold -v` on an arm64 device using musl and mimalloc, then compare it with the working amd64 compile. Use the reported allocation warnings and abort as the failure criteria; done means the arm64 binary runs without the mimalloc out-of-memory errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.