Releases: microsoft/snmalloc
Release list
0.7.5
What's Changed
This release adds C23 API support, pointer-authentication protection for the free list, improved AArch64 platform support, and expanded memory usage statistics in Rust.
New Features
C23 API support
- Expose
free_sized/free_aligned_sizedby @SchrodingerZhu in #832
Security mitigations
- Adding Pointer-Authentication Protection for Free List Forward Edge by @Pengxiang-Huang in #840
Platform support
Rust
- Hotfix for cargo publish by @SchrodingerZhu in #831
- Expose memory usage statistics to Rust via
SnMalloc::memory_stats()by @jayakasadev in #851
Bug Fixes
Testing
- Add tests for
src/snmalloc/override/new.ccby @paulhdk in #839 - Add corruption-detection test for probabilistic mitigations by @mjp41 in #848
- Move
test_memory_statsto an integration test by @mjp41 in #856
Build
CI
- Add cross-platform Coverage CI by @mjp41 in #842
- Reduce ctest wall-time without losing coverage by @mjp41 in #844
- Fix shell quoting in coverage-comment workflow by @mjp41 in #845
- Resolve PR by head SHA in coverage-comment workflow by @mjp41 in #847
- Don't mis-route nightly coverage comment to last-merged PR by @mjp41 in #849
New Contributors
- @paulhdk made their first contribution in #839
- @Pengxiang-Huang made their first contribution in #840
- @jayakasadev made their first contribution in #851
Full Changelog: 0.7.4...0.7.5
0.7.4
What's Changed
Optimisations
- Improve post-teardown performance by Matthew Parkinson (@mjp41) in #810
- Fix performance issue in Red Black Tree init by Matthew Parkinson (@mjp41) in #818
Bug Fixes
- Detect cyclic corruption in SeqSet::iterate by Matthew Parkinson (@mjp41) in #813
Platform support
Rust
- snmalloc-rs moved into snmalloc repo by Matthew Parkinson (@mjp41) in #801
- Rust: Update build features by Matthew Parkinson (@mjp41) in #804
- misc: prepare for future release and bump versions by Schrodinger ZHU Yifan (@SchrodingerZhu) in #807
- Remove unused submodule from snmalloc-rs by Matthew Parkinson (@mjp41) in #827
- Address Rust packaging issues by Matthew Parkinson (@mjp41) in #830
C++ support
- Add SNMALLOC_EXPORT annotation to c++ allocator functions. by akrieger in #822
- inline annotation in pal_windows. by Matthew Parkinson (@mjp41) in #829
Build
- Adding vcpkg integration by Matthew A Johnson (@matajoh) in #825
- Parameterise clangformat_targets for reuse by other projects by Matthew Parkinson (@mjp41) in #826
- Move time concept to Pal by Matthew Parkinson (@mjp41) in #802
CI
- CI Fixes by Matthew Parkinson (@mjp41) in #803
- Refactor CI by Matthew Parkinson (@mjp41) in #806
- Add experiment with Claude.md by Matthew Parkinson (@mjp41) in #819
New Contributors
Full Changelog: 0.7.3...0.7.4
0.7.3
What's Changed
This release primarily improves for CMake for downstream uses of snmalloc.
Build
- CMAKE: Libs should not require headers by Matthew Parkinson (@mjp41) in #797
- Remove interface linking for PRIVATE linkage by Max (@maxtropets) in #799
CI
- Benchmarking automatically by Matthew Parkinson (@mjp41) in #795
- Removing benchmarking from PR triggers by Matthew Parkinson (@mjp41) in #800
New Contributors
- Max (@maxtropets) made their first contribution in #799
Full Changelog: 0.7.2...0.7.3
0.7.2
What's Changed
Secondary Allocator
Thanks to Schrodinger ZHU Yifan (@SchrodingerZhu) for allowing snmalloc to support a secondary allocator, such as GWP-Asan.
This feature allows snmalloc to pass some allocation and their corresponding deallocation to another allocator.
This can be used for a GWP-Asan integration, and will be used to enable detours on Windows to override the default allocator.
- Enable a secondary allocator support (e.g. GWP-Asan) by Schrodinger ZHU Yifan (@SchrodingerZhu) in #737
- Fix test when using GWP-Asan by Matthew Parkinson (@mjp41) in #758
- Make Secondary Allocator a template parameter by Matthew Parkinson (@mjp41) in #774
The next major release will build more on this feature.
Platforms
Windows support
Thanks to Neil Monday (@NeilMonday) for the Windows support improvements in particular the ability to unload snmalloc without leaking the memory associated with snmalloc.
- Windows: Remove exception handler for pagemap on unloading by Neil Monday (@NeilMonday) in #746
- Release all reservations at the very end of the program or DLL by Neil Monday (@NeilMonday) in #773
Rust
- [Rust] add support for optionally compiling libc functions by Will Brown (@wpbrown) in #763
Libc support
- Protection against fork by Matthew Parkinson (@mjp41) in #735
- Update realloc(p,0) semantics. by Matthew Parkinson (@mjp41) in #753
- Prevent internal errno setting escaping to the client. by Matthew Parkinson (@mjp41) in #754
C++ support
- Add exception handling for new operator by Matthew Parkinson (@mjp41) in #791
CI and build
- Mistaken commit of message_once by Matthew Parkinson (@mjp41) in #741
- cmake: Fix HAS_EXCEPTION on Windows. by Matthew Parkinson (@mjp41) in #743
- CI: Refresh Targets by Matthew Parkinson (@mjp41) in #748
- build: Fix nothrow include. by Matthew Parkinson (@mjp41) in #749
- CI: Cancel inflight checks on a new push. by Matthew Parkinson (@mjp41) in #760
- Header-only build fix for WIN32_LEAN_AND_MEAN redefinition by Jeff Sooknarine (@sooknarine) in #764
- Remove 20.04 from CI by Matthew Parkinson (@mjp41) in #768
- Drop Win2019 from CI by Matthew Parkinson (@mjp41) in #778
- Update minimum CMake version #793
Bazel
Thanks to Jaya Kasa (@jayakasadev) for adding Bazel support to snmallocs build.
- feat: add support for bazel by Jaya Kasa (@jayakasadev) in #759
- Add build platform and type to Bazel cache key by Matthew Parkinson (@mjp41) in #779
Refactor and minor bugs fixes
- Refactor: Remove unused features and functions, and move most allocator operations to a global namespace. by Matthew Parkinson (@mjp41) in #750
- Bug fixes by Matthew Parkinson (@mjp41) in #752
- Fixed pagemap reservations for a fixed-region use-case using the default PAL by Trithek in #757
- Refactor check_bounds by Matthew Parkinson (@mjp41) in #756
- Refactor representation of thread local state. by Matthew Parkinson (@mjp41) in #751
- Fix bug in pool sort by Matthew Parkinson (@mjp41) in #765
- Reentrancy init by Matthew Parkinson (@mjp41) in #767
- Fix CI by Matthew Parkinson (@mjp41) in #776
- Remove tests for experimental jemalloc ABIs by Mark Johnston (@markjdb) in #770
- Adjust func-memory test to be shorter. by Matthew Parkinson (@mjp41) in #780
- Improve sizeclass calculation by Matthew Parkinson (@mjp41) in #777
- Pass continuations for success and failure cases by Matthew Parkinson (@mjp41) in #788
- Fallible notify using by Matthew Parkinson (@mjp41) in #790
- Code Quality - inlining and reduce PreventFork usage by Matthew Parkinson (@mjp41) in #792
New Contributors
- Trithek made their first contribution in #757
- Jeff Sooknarine (@sooknarine) made their first contribution in #764
- Will Brown (@wpbrown) made their first contribution in #763
- Jaya Kasa (@jayakasadev) made their first contribution in #759
- Mark Johnston (@markjdb) made their first contribution in #770
Full Changelog: 0.7.1...0.7.2
0.7.1
What's Changed
If you are using 0.7.0, it is highly recommended you update to 0.7.1 to fix a bug in the wake on address implementation.
Bug Fixes
- Multiple PALs could return spuriously from wake on address by Matthew Parkinson (@mjp41) and Wareya (@wareya) #739
Optimisations
- Limit remote batch size by Matthew Parkinson (@mjp41) in #724
Platform support
- Improve Windows memcpy protection using an exception handler in the PAL to lazily commit the pagemap by Matthew Parkinson (@mjp41) in #727 & #730
- OpenBSD add support for WaitOnAddress by David CARLIER (@devnexen) in #716
- Solaris add support for OS level Aligned Allocation by David CARLIER (@devnexen) in #723
- MinGW fixed missing <errno.h> for ENOMEM by Jean-Michaël Celerier (@jcelerier) in #733
- MSVC fix signature of _msize function by Neil Monday (@NeilMonday) in #708
- OpenBSD: memcpy test fix build warning. by David CARLIER (@devnexen) in #714
Docs
- Updating the build doc by Neil Monday (@NeilMonday) in #705
- Remove Morello CI Badge by Matthew Parkinson (@mjp41) in #710
Build
- cmake: detect rdynamic flag by Jean-Michaël Celerier (@jcelerier) in #699
- cmake: restrict usage of
_HAS_EXCEPTIONS=0by Matthew Parkinson (@mjp41) in #707 - Change
DEBUGconstexpr toDebugby Neil Monday (@NeilMonday) in #729 - cmake: Fixes for Arch Luinux by Matthew Parkinson (@mjp41) in #734
CI
- Updates to handle newer Ubuntu images by Matthew Parkinson (@mjp41) in #726
- Update MacOS machines, and add Tracing Target by Matthew Parkinson (@mjp41) in #706
Code Refactoring
- Remove PAL dependencies from Singleton and FlagLock by Matthew Parkinson (@mjp41) in #725
- Refactor headers to enable building as a component inside a libc implementation Schrodinger ZHU Yifan (@SchrodingerZhu) in
- remove TrivialInitAtomic by Schrodinger ZHU Yifan (@SchrodingerZhu) in #711
- remove string_view STL dependency by Schrodinger ZHU Yifan (@SchrodingerZhu) in #703
- simplify MessageBuilder construction by Schrodinger ZHU Yifan (@SchrodingerZhu) in #713
- start self-vendored STL with atomic by Schrodinger ZHU Yifan (@SchrodingerZhu) in #715
- provide proxy layers for type traits by Schrodinger ZHU Yifan (@SchrodingerZhu) in #717
- remove chrono dependency for windows by Schrodinger ZHU Yifan (@SchrodingerZhu) in #718
- use customised placement-new by Schrodinger ZHU Yifan (@SchrodingerZhu) in #719
- use c headers instead of c++ headers by Schrodinger ZHU Yifan (@SchrodingerZhu) in #720
- self-vendor utility headers by Schrodinger ZHU Yifan (@SchrodingerZhu) in #721
- self vendor array and algorithm headers by Schrodinger ZHU Yifan (@SchrodingerZhu) in #722
- remove extra puts definitions by Schrodinger ZHU Yifan (@SchrodingerZhu) in #731
New Contributors
- Jean-Michaël Celerier (@jcelerier) made their first contribution in #699
- Neil Monday (@NeilMonday) made their first contribution in #705
- Wareya (@wareya) made their first contribution in #739
Full Changelog: 0.7.0...0.7.1
0.7.0
What's Changed
See https://github.com/microsoft/snmalloc/blob/main/docs/release/0.7/README.md for an introduction to the 0.7 release.
Optimisation
Startup time
- Startup improvements by Matthew Parkinson (@mjp41) in #639
- Startup speed by Matthew Parkinson (@mjp41) in #665
- Implement MCS Combining lock by Matthew Parkinson (@mjp41) in #666
- Add documentation for the combining lock by Matthew Parkinson (@mjp41) in #683
- implement polite waiting by Schrodinger ZHU Yifan (@SchrodingerZhu) in #685
Produce Consumer workloads (BatchIt)
- Using exclusive mode prefetch by Matthew Parkinson (@mjp41) in #627
- Refactorings to support BatchIt by Nathaniel Filardo, once at MS Research (@nwf-msr) in #652
- msgpass benchmark and its refactoring dependencies by Nathaniel Filardo, once at MS Research (@nwf-msr) in #659
- Bottom commits from BatchIt by Nathaniel Filardo, once at MS Research (@nwf-msr) in #675
- BatchIt by Nathaniel Wesley Filardo (@nwf) in #677
Security Features
- Configurable client meta-data by Matthew Parkinson (@mjp41) in #662
Platforms and Bindings
Libc
- Factor out libc code into a header. by Matthew Parkinson (@mjp41) in #624
- Remove unnecessary assertion from aligned_alloc by Matthew Parkinson (@mjp41) in #658
- aligned_alloc: Permit alignment values smaller than sizeof(uintptr_t) by John Baldwin (@bsdjhb) in #671
- aligned_alloc requirements update. by David CARLIER (@devnexen) in #681
Rust
- export snmalloc::alloc_size to rust wrappers. by David CARLIER (@devnexen) in #676
Windows
- Override _msize on windows by Zhang (@Naville) in #633
- Disable empty static prefix for Windows. by Matthew Parkinson (@mjp41) in #629
- Add Windows ARM64 support by Javier Blazquez (@jblazquez) in #656
Haiku
- PAL::haiku finally supports getentropy. by David CARLIER (@devnexen) in #684
NetBSD
- neasing netbsd build. by David CARLIER (@devnexen) in #696
Minor changes and refactorings
- Add a default constructor to seqset nodes. by David Chisnall (@davidchisnall) in #636
- Template construction of Pool elements by Matthew Parkinson (@mjp41) in #641
- NFC: sizeclass: differentiate minimum step size and minimum allocation sizes by Nathaniel Filardo, once at MS Research (@nwf-msr) in #651
- Refactor new/delete overrides by Matthew Parkinson (@mjp41) in #660
- Remove the SNMALLOC_USE_CXX17 C preprocessor symbol by Nathaniel Filardo, once at MS Research (@nwf-msr) in #667
- 0-length arrays in Buddy ranges by Nathaniel Filardo, once at MS Research (@nwf-msr) in #672
- gcc UAF warning in test/perf/singlethread -malloc by Nathaniel Wesley Filardo (@nwf) in #679
- Remove some unneeded headers by Matthew Parkinson (@mjp41) in #680
- Remove unneeded template. by Matthew Parkinson (@mjp41) in #687
Build and CI
- Move to clang-format 15 by Matthew Parkinson (@mjp41) in #621
- Adding an option to enable dynamic loading by Matthew A Johnson (@matajoh) in #632
- Add C++17 version for Mac. by Matthew Parkinson (@mjp41) in #635
- Workaround runner issue. by Matthew Parkinson (@mjp41) in #645
- FreeBSD CI. by Matthew Parkinson (@mjp41) in #647
- Update NetBSD runner by Matthew Parkinson (@mjp41) in #648
- Updated CI workaround. by Matthew Parkinson (@mjp41) in #650
- Rework CI by Nathaniel Filardo, once at MS Research (@nwf-msr) in #674
- Further gcc -Werror=array-bounds fix by Nathaniel Wesley Filardo (@nwf) in #678
- Provide option to CMake for Page Size by Matthew Parkinson (@mjp41) in #664
- fuzzing test and detect the memmove error by Schrodinger ZHU Yifan (@SchrodingerZhu) in #688
- Add fuzz to CI by Matthew Parkinson (@mjp41) in #690
- clean up Result and make Result move-only by Schrodinger ZHU Yifan (@SchrodingerZhu) in #691
- Minor update to clangformat file. by Matthew Parkinson (@mjp41) in #694
- avoid chrono inclusion when clock_gettime is available by Schrodinger ZHU Yifan (@SchrodingerZhu) in #695
New Contributors
- Matthew A Johnson (@matajoh) made their first contribution in #632
- Zhang (@Naville) made their first contribution in #633
- Javier Blazquez (@jblazquez) made their first contribution in #656
- John Baldwin (@bsdjhb) made their first contribution in #671
Full Changelog: 0.6.2...0.7.0
0.6.2
Minor release primarily improving support on CHERI and Open Enclave
- CHERI (#587, #557, #578)
- Open Enclave provide new low memory mode that disables some thread caching (#612, #617)
- Improve security checks (emptyness #569, separate features #587))
- Improve ranges support (#540, #556, #562, #619)
- Performance (#604, #605, #606, #607)
- NetBSD support (#583)
- ARM support (#564, #601
- Debug performance improvement (#585)
- Fix C++ overrides argument order that caused a assert failure (#597)
- Improve override for RTLD_DEEPBIND (#598)
- Code tidying (#548, #554, #558, #565, #568)
- C++ support (#574, #581, #591)
- CI improvements/build ( #555, #559, #579, #580, #582, #588, #589, #590, #592, #599, #608, #613, #614, #620)
- Documentation (#602, #610, #611)
Thanks to David CARLIER (@devnexen), Saar Amar (@saaramar), Axel PASCON (@brvtalcake), Julien Maffre (@jumaffre) and EAirPeter (@EAirPeter) for your contributions to this release.
0.6.1
Minor release. Largest change is bringing online Morello CHERI support.
- CHERI support (#537, #542, #532, #543)
- Improve error messages for checks (#526, #521)
- Increased checks on client (#520, #550)
- Portability fixes for Haiku and older versions of glibc (#545, #546, #533)
- Expose macOS
malloc_good_size(#538) - General code tidying (#527, #535, #547, #551, #536, #534, #529)
- Documentation (#551, #522)
Thanks to the external contributors Jakub Panek (@panekj), David CARLIER (@devnexen) and Matthias Wahl (@mfelsche).
0.6.0
This is a major revision of the snmalloc design. The redesign has been primarily focused on adding new security features. The redesign affects all aspects of snmalloc. A more comprehensive explanation of the new features can be found in the docs
- Uses Buddy Allocators for large allocations: In 0.5.3, we never reconsolidate large allocations, so if you ask for several 1MiB allocations, return them, and then ask for several 2MiB allocations it won't be able to use the space from the 1MiB allocations. This is not a problem in 0.6 as we have a proper buddy allocator at that level so we recombine the big bits of memory properly
- Variable sized slabs and out of band meta-data - Previously, snmalloc used fixed sized super slabs with metadata at the head. By using variable sized slabs and out of band meta-data, the slabs don't have to be grouped into superslabs which reduces the minimum memory requirement. (https://github.com/microsoft/snmalloc/blob/main/docs/security/VariableSizedChunks.md)
- Improved per thread caching - #511 - This enables very small per thread usage initially that can grow to the level required. This means that low foot print scenarios on OpenEnclave can be supported with exactly the same code paths as high footprint scenarios. This brings the per thread costs down to approximately 16k per thread of metadata + 16k per thread per sizeclass used. This will grow in powers of 2 (upto 2MiB) to cover the required amount.