microsoft / microsoft/mimalloc

Crash in mi_segment_init

Open
#469 7 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

We pulled memory modules from a machine to limit the amount of available memory. Then we tested our server process which would intentionally run out of memory.

The mimalloc library crashed in mi_segment_init() on the line "segment->memid = memid". Apparently segment was not NULL, and it was not a valid memory location.

Exception: dwFirstChance 1
2021/10/19 12:27:39
dwProcessId 1156
dwThreadId 6356
ExceptionCode '0xc0000005: EXCEPTION_ACCESS_VIOLATION'
ExceptionFlags 'EXCEPTION_CONTINUABLE'
ExceptionAddress 0x00007ff74466b133
Reason 'write'
Data Address 0x0000058852c00000

Still single stepping this code in the debugger to make sense of this.

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 in mi_segment_init() and inspect the segment->memid = memid write described in the report. Reproduce the server process under the reduced-memory conditions, using the supplied access-violation details to investigate why segment is invalid. Done means identifying and fixing the crash and confirming the process handles intentional out-of-memory conditions without this fault.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.