microsoft / microsoft/mimalloc

mimalloc crashes with asan

Open
#317 10 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

version v1.6.7
os: Ubuntu Linux 5.9
compiler: gcc 10.2.0

Crash happens before main() is started. See the stacktrace below:

#0  0x0000000000000000 in ?? ()
#1  0x0000555556820159 in _os_random_weak (extra_seed=extra_seed@entry=93825011932384) at third_party/mimalloc/src/random.c:265
#2  0x000055555681dfac in mi_heap_main_init () at third_party/mimalloc/src/init.c:144
#3  mi_heap_main_init () at third_party/mimalloc/src/init.c:141
#4  mi_process_init () at third_party/mimalloc/src/init.c:470
#5  0x000055555681e00a in mi_thread_init () at third_party/mimalloc/src/init.c:338
#6  0x0000555556829425 in _mi_malloc_generic (heap=0x555556c21ea0 <_mi_heap_empty>, size=32) at third_party/mimalloc/src/page.c:813
#7  0x0000555556819afb in mi_heap_malloc (size=32, heap=<optimized out>) at third_party/mimalloc/src/alloc.c:94
#8  _mi_heap_malloc_zero (zero=true, size=32, heap=<optimized out>) at third_party/mimalloc/src/alloc.c:139
#9  mi_heap_zalloc (size=32, heap=<optimized out>) at third_party/mimalloc/src/alloc.c:147
#10 mi_heap_calloc (size=32, count=1, heap=<optimized out>) at third_party/mimalloc/src/alloc.c:548
#11 mi_calloc (count=count@entry=1, size=size@entry=32) at third_party/mimalloc/src/alloc.c:552
#12 0x00007ffff66f0c05 in _dlerror_run (operate=operate@entry=0x7ffff66f0490 <dlsym_doit>, args=args@entry=0x7fffffffdc70) at dlerror.c:148
#13 0x00007ffff66f0525 in __dlsym (handle=<optimized out>, name=0x7ffff76dac12 "mmap") at dlsym.c:70
#14 0x00007ffff76c0199 in ?? () from /lib/x86_64-linux-gnu/libasan.so.6
#15 0x00007ffff767dc88 in ?? () from /lib/x86_64-linux-gnu/libasan.so.6
#16 0x00007ffff769d49b in ?? () from /lib/x86_64-linux-gnu/libasan.so.6
#17 0x00007ffff7fe0ce6 in ?? () from /lib64/ld-linux-x86-64.so.2

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 with the stack trace locations in third_party/mimalloc/src/random.c:265 and third_party/mimalloc/src/init.c:141-144, then inspect how initialization interacts with AddressSanitizer before main(). Reproduce with mimalloc v1.6.7 on Ubuntu Linux 5.9 using gcc 10.2.0; done means the crash no longer occurs before main().

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, ubuntu
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.