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

MacOS error reappearing again #280

Open
reubenharry opened this issue Jan 27, 2024 · 10 comments · May be fixed by #283
Open

MacOS error reappearing again #280

reubenharry opened this issue Jan 27, 2024 · 10 comments · May be fixed by #283

Comments

@reubenharry
Copy link

Running on a Mac (recently updated), when I run the rhine-bayes executable via cabal run rhine-bayes-gloss I get

2024-01-27 18:24:27.834 rhine-bayes-gloss[13639:2049511] GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: NSWindow drag regions should only be invalidated on the Main Thread!

(after selecting any of the 3 options in the list).

Curiously, I wasn't having this problem earlier today, and am on the master branch, and did cabal clean. Any ideas? (I'm on ghc 9.4.8)

(I've previously been able to resolve this issue, e.g. in my rhine-bayes-examples repo, but I can't presently remember how).

@reubenharry
Copy link
Author

OK, closing this issue, as I remembered the fix, which is: use flowGlossIO and removed -threaded in the compilation options.

@turion
Copy link
Owner

turion commented Jan 29, 2024

Ah, great you remembered! Shouldn't we change the code then?

@turion turion reopened this Jan 29, 2024
@turion
Copy link
Owner

turion commented Jan 29, 2024

Using flowGlossIO shouldn't have an effect, it's defined as launchInGlossThread settings . flow. But I guess -threaded makes a huge effect. Maybe it's possible to conditionally disable -threaded on mac?

@reubenharry
Copy link
Author

Hmm interested. Just removing -threaded was not sufficient (although certainly necessary), so then it's unclear what I did to make it work...

@turion
Copy link
Owner

turion commented Jan 30, 2024

This is tricky: When you change the GHC options in the cabal files, it doesn't necessarily recompile (although it morally should). Can you maybe add a line of comment, recompile, and check whether changing -threaded maybe in fact is the relevant change?

@turion turion linked a pull request Jan 30, 2024 that will close this issue
5 tasks
@reubenharry
Copy link
Author

I did cabal clean first. Would that cause recompilation?

@turion
Copy link
Owner

turion commented Jan 30, 2024

I would have thought it should. This is confusing. Can you try the following:

  1. Go to master
  2. cabal clean or git clean
  3. cabal run rhine-bayes-gloss (this should throw the error)
  4. Remove the flag
  5. cabal run rhine-bayes-gloss (this should still throw the error, right?)
  6. Use flowGlossIO directly (now the error is gone?)
  7. Remove flowGlossIO again (now the error returns?)

If the last steps are as predicted, then using flowGlossIO is indeed necessary.

@reubenharry
Copy link
Author

I stand corrected! After 4, the bug is resolved. Sorry for the confusion.

@reubenharry
Copy link
Author

So yeah, maybe we can disable -threaded conditionally on mac.

@turion
Copy link
Owner

turion commented Jan 30, 2024

Fantastic, thanks!

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

Successfully merging a pull request may close this issue.

2 participants