Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault with MinGW on Windows #69

Open
Aurailus opened this issue Sep 3, 2021 · 9 comments
Open

Segfault with MinGW on Windows #69

Aurailus opened this issue Sep 3, 2021 · 9 comments

Comments

@Aurailus
Copy link

Aurailus commented Sep 3, 2021

Hi! I'm encountering a strange issue with FastNoise2 on windows. When trying to call GenSingle3D on a FractalFBm module, a segfault occurs. This behaviour is present in the latest commit as well as the last release, and we managed to replicate it with just the following code, which should segfault at the GenSingle3D call:

int main(int argc, char* argv[]) {
    auto biomePerlin = FastNoise::New<FastNoise::Simplex>();
    
    auto biomeScale = FastNoise::New<FastNoise::DomainScale>();
    biomeScale->SetSource(biomePerlin);
    biomeScale->SetScale(1/1000.f);
    
    auto biomeFractal = FastNoise::New<FastNoise::FractalFBm>();
    biomeFractal->SetSource(biomePerlin);
    
    float val = biomeFractal->GenSingle3D(0, 0,0, 1337);
    
    std::cout << val << std::endl;
}

Compiled with C++17, MinGW on Windows.

@Auburn
Copy link
Owner

Auburn commented Sep 3, 2021

I have not tested MinGW on Windows, only MSVC and ClangCL. The code above works on latter 2 compilers.

Can you give any more details on the crash?

@SamCZ
Copy link

SamCZ commented Sep 3, 2021

image

@SamCZ
Copy link

SamCZ commented Sep 3, 2021

This will happen even on clean clone of repo
image

@Auburn Auburn changed the title Segfault with FractalFBm on Windows Segfault with MinGW on Windows Sep 3, 2021
@Auburn
Copy link
Owner

Auburn commented Sep 3, 2021

Well that doesn't look like a simple fix, I'll put MinGW support on my ToDo list but I'm busy with a few other tasks currently. If you want to look into it further yourself I'm happy to provide some guidance, probably best to do that over Discord chat though

@SamCZ
Copy link

SamCZ commented Sep 3, 2021

ok, I will look into it, my discord is: Sam Freki#9144

@Auburn
Copy link
Owner

Auburn commented Sep 3, 2021

There is a FastNoise Discord

Another option is to compile it as a DLL using one of the supported compilers and use it via the C interface, but that's not an ideal solution

@SamCZ
Copy link

SamCZ commented Sep 3, 2021

Yeah and its weird that the segfault is only present on some generators

@Auburn
Copy link
Owner

Auburn commented Oct 18, 2021

MinGW does not support AVX code on Windows https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412

@Auburn
Copy link
Owner

Auburn commented Apr 27, 2024

I just tried to test this, I didn't seem to get the segfault. Not sure if it's been fixed? The bug report linked above is still open.

I'm testing on GNU 13.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants