snmalloc pessimal performance in post-main cleanup
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start with the header-only override snippet in the issue and the linked Cataclysm-DDA integration pull request, then reproduce the Windows test-binary cleanup behavior. Use the reported profiling results to determine whether the post-main iteration is expected or a snmalloc bug; done means the behavior is explained and, if defective, a focused fix or reproduction is identified.
Written by the indexing model from the issue text.
Description
While integrating snmalloc into https://github.com/CleverRaven/Cataclysm-DDA, I noticed a bizarre issue crop up: snmalloc seeming causing a hang post completion of the test binary. Profiling on Windows shows that it seems to spend all of its cycles repeatedly iterating some internal structure at exorbitant cost. I'm not sure if this is simply expected behavior due to a large number of deallocations at once or if it a bad interaction with post-main thread behavior violating snmalloc's assumptions.
The pull request for the integration is https://github.com/CleverRaven/Cataclysm-DDA/pull/85099. I am using the 'header only' style build method with the following (simplified) contents to override just new/delete for Windows.
#define SNMALLOC_USE_WAIT_ON_ADDRESS 1
#ifndef _WIN32
#include <snmalloc/override/malloc.cc> // NOLINT(bugprone-suspicious-include)
#endif
#include <snmalloc/override/new.cc> // NOLINT(bugprone-suspicious-include)
- Dominant language
- C++
- Stars
- 2k
- Forks
- 138
- Avg merge
- 11h 19m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/snmalloc
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in microsoft/snmalloc
Similar issues
-
Website Doc Typo Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
automated-analysis bug memory-safety
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100