hs_alloc_scratch failed: -6
- Dominant language
- C++
- Stars
- 5.5k
- Forks
- 816
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 2
Description
I was getting a -6 error from hs_alloc_scratch. It looks like that happens when the CPU features at compile time don't match those of the currently running host. We are using fat binaries and building on a host that doesn't support AVX512 and AVX2. The host we're running on does support those CPU features. When we got that -6 error we were passing NULL for the platform argument to hs_compile. I changed the code to use hs_populate_platform to populate the platform struct and then cleared the CPU features to match what was used at compile time. Then I passed that to hs_compile. We don't get the error anymore but is that the correct way to fix that error? Is it possible to compile on a host that doesn't support AVX512 and AVX2 but have those enabled on a host that does support them?
Thanks,
Aaron
Contributor guide
Assessment
This issue has not been assessed yet.