jemalloc / jemalloc/jemalloc

assert failed when destory an arena that has a slab in slabs_nonfull

Open
#1,811 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.2k
Forks
1.6k
Avg merge
4d 8h
Merged PRs (30d)
13

Description

In ctl_arena_stats_sdmerge , this assert checks that all bins which is in a destoryed arena must
satisfy bin.nonfull_slabs==0 .
https://github.com/jemalloc/jemalloc/blob/4f8efba8248aaafa2200e3538bae126729e0407d/src/ctl.c#L957
However the arena_bin_reset doesn't set nonfull_slabs to zero.
https://github.com/jemalloc/jemalloc/blob/4f8efba8248aaafa2200e3538bae126729e0407d/src/arena.c#L610
Then we will meet a assert failure when we destory an arena that slabs_nonfull!=0 (has a slab in slabs_nonfull).

POC: https://github.com/wangxiyu191/jemalloc/commit/c07909813f412ee71b5e72e0eae8dcf9b4de708e
Possible fix: https://github.com/wangxiyu191/jemalloc/commit/888281462d23887905343d02f4379238516eb25a

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 at ctl_arena_stats_sdmerge in src/ctl.c around line 957 and arena_bin_reset in src/arena.c around line 610; compare the assertion with the reset behavior and review the linked POC and possible-fix commits. Done means destroying an arena containing a slab in slabs_nonfull no longer triggers the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.