Comment #0 by stojkovic.igor — 2021-01-31T19:13:32Z
Following code fails with SegFault:
```
module test.main;
private __gshared ubyte[4096 * 1024] buffer;
int main(string[] args)
{
import std.digest.crc : crc32Of;
ubyte[4] pcrc = buffer.crc32Of(); // SegFault reported here
return pcrc[0];
}
```
Tried with DMD 2.095.0 and LDC 1.24.0.
Comment #1 by apz28 — 2021-02-04T00:55:06Z
This construct will cause the function to pass fixed length array ubyte[4194304] and construct struct CRC(uint N, ulong P) with N=64u & P=15564440312192434176LU hence stack overflow. Change to dynamic array construct should fix the problem
ubyte[4] pcrc = buffer[].crc32Of();
Comment #2 by robert.schadek — 2024-12-01T16:38:21Z