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

std::mt19937 crashes with toolchain build on windows #8

Open
squinkylabs opened this issue Aug 2, 2021 · 2 comments
Open

std::mt19937 crashes with toolchain build on windows #8

squinkylabs opened this issue Aug 2, 2021 · 2 comments

Comments

@squinkylabs
Copy link

Once again I've run into compatibility problem with the toolchain build in windows where it crashes with perectly good c++ code.

This time it's in mt19937. Calling it from my process(args) function corrupts the stack and crashes. Since I need to do this I may have to use an open-source implementation of the mersenne twister algorithm.

So far my problems are:

  1. sometimes trying to catch an exception in draw code crashed the toolchain build (but not a local msys build). Solution: remove the code that does that.

  2. using std::stringstream from draw code crashes with the toolchain build (but not a local msys build). Solution: wrote my own subset of stringstream that works.

  3. [new] calling mt19937 from process call immediately crashes with a corrupt stack. solution: none yet.

@cschol
Copy link
Collaborator

cschol commented Aug 4, 2021

Can you explain your use case for the mt19937? There are about 40 instances in plugins throughout the entire library of plugins. Maybe we can narrow down what is different with your code?

@squinkylabs
Copy link
Author

Yeah, in this case I call it every now and then from my module's process function. I usually use a static instance of it, but I tried doing something more normal. There certainly could be something odd in my plugin that makes all these issues happen. I've had little luck isolating it so far, but I can try again. I never, ever have problems like these with my desktop builds - they always come up with toolchain builds. It certainly "acts" like the version of the c++ std library that the build toolchain uses is not compatibly with the compiled module.

In the past all my crashes were from doing things on the drawing thread, but this one is on the engine thread. I'll try to repro in a different plugin.

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

2 participants