mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Stack Overflow due to large stack allocations #705
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RawScape on GitHub (Oct 22, 2025).
I experienced stack overflows in my program accompanied by a dump-file.
Analyzing this dump lead me to SharpCompress.
Specifically "SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs" where larger chunks of memory are allocated on the stack.
Since I decompress several Archives in parallel this leads to a stack overflow.
I replaced
with
and this solved my problem.
I can see other similar large stack allocations in the project.
But this is the one that caused my crashes.
@adamhathcock commented on GitHub (Oct 22, 2025):
Thanks!
I fixed the reported thing here https://github.com/adamhathcock/sharpcompress/pull/966
I took a brief look to see there's any other potentially large dynamic stackallocs and I don't see any. Hopefully this fixes it.