microsoft / microsoft/mimalloc

Crash on Linux while using mimalloc v2.0.6 and Wwise

Open
#627 0 comments 0 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

Hello!
I found a bug in mimalloc v2.0.6 on Linux when using Audiokinetic's Wwise. Fixed it locally with patch from jemalloc:

```
#include
// glibc provides the RTLD_DEEPBIND flag for dlopen which can make it possible
// to inconsistently reference libc's malloc(3)-compatible functions
// (https://bugzilla.mozilla.org/show_bug.cgi?id=493541).
//
// These definitions interpose hooks in glibc. The functions are actually
// passed an extra argument for the caller return address, which will be ignored.
__attribute__((visibility("default"))) void (*__free_hook)(void *ptr) = mi_free;
__attribute__((visibility("default"))) void *(*__malloc_hook)(size_t size) = mi_malloc;
__attribute__((visibility("default"))) void *(*__realloc_hook)(void *ptr, size_t size) = mi_realloc;
__attribute__((visibility("default"))) void *(*__memalign_hook)(size_t alignment, size_t size) = mi_memalign;
```

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 Linux crash with mimalloc v2.0.6 and Audiokinetic Wwise, then inspect the glibc hook definitions shown in the issue: __free_hook, __malloc_hook, __realloc_hook, and __memalign_hook. Compare the local jemalloc-derived patch with the Linux integration; done means the Wwise case no longer crashes and the behavior has a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.