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

runtime assertion failure on OSX #2

Closed
vixr opened this issue Dec 16, 2015 · 4 comments
Closed

runtime assertion failure on OSX #2

vixr opened this issue Dec 16, 2015 · 4 comments

Comments

@vixr
Copy link

vixr commented Dec 16, 2015

Also on OSX, OSX 10.9.5 with GHC 7.10.2.

Unlike the other issue I'm able to install the library, but when I run the line.hs example, I get a runtime assertion error:

2015-12-16 13:52:45.710 ghc[87780:3923] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1056.17/Misc.subproj/NSUndoManager.m:328
2015-12-16 13:52:45.711 ghc[87780:3923] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2015-12-16 13:52:45.712 ghc[87780:3923] (
    0   CoreFoundation                      0x00007fff8a99125c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8a3d6e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8a991038 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff884b4361 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   Foundation                          0x00007fff8841e8ac +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
    5   AppKit                              0x00007fff8715ca23 -[NSApplication run] + 688
    6   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aedce _glfwPlatformCreateWindow + 1406
    7   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aa215 glfwCreateWindow + 597
    8   libHSGLFW-b-1.4.7.3-2m35VL0BDrNCZEuOHcVt2q-ghc7.10.2.dylib 0x000000010b301a55 c2j3c_info + 205
)
2015-12-16 13:52:45.736 ghc[87780:3923] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1056.17/Misc.subproj/NSUndoManager.m:328
2015-12-16 13:52:45.738 ghc[87780:3923] An uncaught exception was raised
2015-12-16 13:52:45.738 ghc[87780:3923] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2015-12-16 13:52:45.738 ghc[87780:3923] (
    0   CoreFoundation                      0x00007fff8a99125c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8a3d6e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8a991038 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff884b4361 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   Foundation                          0x00007fff8841e8ac +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
    5   AppKit                              0x00007fff8715cacd -[NSApplication run] + 858
    6   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aedce _glfwPlatformCreateWindow + 1406
    7   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aa215 glfwCreateWindow + 597
    8   libHSGLFW-b-1.4.7.3-2m35VL0BDrNCZEuOHcVt2q-ghc7.10.2.dylib 0x000000010b301a55 c2j3c_info + 205
)
2015-12-16 13:52:45.766 ghc[87780:3923] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8a99125c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8a3d6e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8a991038 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff884b4361 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   Foundation                          0x00007fff8841e8ac +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
    5   AppKit                              0x00007fff8715cacd -[NSApplication run] + 858
    6   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aedce _glfwPlatformCreateWindow + 1406
    7   libHSbindings-GLFW-3.1.1.4-9AhPcguGaCFDeBLb2CVBKw-ghc7.10.2.dylib 0x000000010b2aa215 glfwCreateWindow + 597
    8   libHSGLFW-b-1.4.7.3-2m35VL0BDrNCZEuOHcVt2q-ghc7.10.2.dylib 0x000000010b301a55 c2j3c_info + 205
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@adamwalker
Copy link
Owner

Thanks for the bug report.

It looks like something is going wrong during the call to createWindow in glfw. The only glfw calls I make before that are to initialize glfw and set the error callback, so I don't imagine my usage of the glfw api is causing the problem.

Are you running this in GHCI? if so see the docs here:
https://hackage.haskell.org/package/GLFW-b-1.4.7.3/docs/Graphics-UI-GLFW.html
for the createWindow function. That might be the cause of it.

@masterdezign
Copy link

Hello,

I report a similar issue trying to build and then execute examples/waterfall.hs
Build does not cause any problems, however execution fails:

2016-10-26 15:21:06.251 waterfall-exe[23358:1086816] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1259/Misc.subproj/NSUndoManager.m:359
2016-10-26 15:21:06.251 waterfall-exe[23358:1086816] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2016-10-26 15:21:06.253 waterfall-exe[23358:1086816](0 CoreFoundation 0x00007fff8c52e4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8949c73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff8c5331ca +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff89df5856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 Foundation 0x00007fff89d7aaf1 +[NSUndoManager%28NSPrivate%29 _endTopLevelGroupings] + 170
5 AppKit 0x00007fff98f95e22 -[NSApplication run] + 844
6 waterfall-exe 0x00000001058d9b1b _glfwPlatformCreateWindow + 1563
7 waterfall-exe 0x00000001058decd5 glfwCreateWindow + 597
8 waterfall-exe 0x0000000105807fdd GLFWzmbzm1zi4zi8zi0zmGmzzj4oUBhnKD32OQw4NQ6E_GraphicsziUIziGLFW_destroyWindow_info + 661)
2016-10-26 15:21:06.253 waterfall-exe[23358:1086816] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1259/Misc.subproj/NSUndoManager.m:359
2016-10-26 15:21:06.254 waterfall-exe[23358:1086816] An uncaught exception was raised
2016-10-26 15:21:06.254 waterfall-exe[23358:1086816] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2016-10-26 15:21:06.254 waterfall-exe[23358:1086816](0 CoreFoundation 0x00007fff8c52e4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8949c73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff8c5331ca +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff89df5856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 Foundation 0x00007fff89d7aaf1 +[NSUndoManager%28NSPrivate%29 _endTopLevelGroupings] + 170
5 AppKit 0x00007fff98f95ebe -[NSApplication run] + 1000
6 waterfall-exe 0x00000001058d9b1b _glfwPlatformCreateWindow + 1563
7 waterfall-exe 0x00000001058decd5 glfwCreateWindow + 597
8 waterfall-exe 0x0000000105807fdd GLFWzmbzm1zi4zi8zi0zmGmzzj4oUBhnKD32OQw4NQ6E_GraphicsziUIziGLFW_destroyWindow_info + 661)
2016-10-26 15:21:06.254 waterfall-exe[23358:1086816] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8c52e4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8949c73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff8c5331ca +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff89df5856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 Foundation 0x00007fff89d7aaf1 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 170
5 AppKit 0x00007fff98f95ebe -[NSApplication run] + 1000
6 waterfall-exe 0x00000001058d9b1b _glfwPlatformCreateWindow + 1563
7 waterfall-exe 0x00000001058decd5 glfwCreateWindow + 597
8 waterfall-exe 0x0000000105807fdd GLFWzmbzm1zi4zi8zi0zmGmzzj4oUBhnKD32OQw4NQ6E_GraphicsziUIziGLFW_destroyWindow_info + 661
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I run ghc 8.0.1 on Mac OS X 10.11.

Below is my stack.yaml

resolver: lts-7.2
flags: {}
extra-package-dbs: []
packages:

  • '.'
    extra-deps:
  • dynamic-graph-0.1.0.9
  • GLUtil-0.9.1.0
  • hpp-0.3.1.0

Additionally, here is how the executable is defined in cabal file:

executable waterfall-exe
hs-source-dirs: src
main-is: Waterfall.hs
ghc-options: -fwarn-missing-signatures -threaded -rtsopts
build-depends: base
, dynamic-graph
, either
, pipes
, random
, OpenGL
default-language: Haskell2010

@adamwalker
Copy link
Owner

Thanks for the bug report.

Unfortunately, as I don't have a computer running Mac OS, so I can't really debug this. And, even if I did, I wouldn't know where to start.

@adamwalker
Copy link
Owner

Fixed in commit: b9780bb

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