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

Can't build on Mac OS X after upgrading to Xcode 8 #20

Open
niels-s opened this issue Sep 17, 2016 · 9 comments
Open

Can't build on Mac OS X after upgrading to Xcode 8 #20

niels-s opened this issue Sep 17, 2016 · 9 comments

Comments

@niels-s
Copy link

niels-s commented Sep 17, 2016

I had written a go program which was using systray just fine until I update xcode to version 8 which comes with a new set of developer tools. Now I can run of build my tool using systray anymore.
Does any one got any tips what I need to debug or how I can fix the issue?

I got the following stacktrace:

2016-09-17 17:25:32.634 main[2925:156856] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1259/Misc.subproj/NSUndoManager.m:359
2016-09-17 17:25:32.635 main[2925:156856] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2016-09-17 17:25:32.635 main[2925:156856] (
    0   CoreFoundation                      0x00007fff8802f4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8958373c objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff880341ca +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff90fef856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   Foundation                          0x00007fff90f74af1 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 170
    5   AppKit                              0x00007fff9319ae22 -[NSApplication run] + 844
    6   main                                0x0000000004356d30 nativeLoop + 128
    7   main                                0x00000000043566fa _cgo_8c6479959095_Cfunc_nativeLoop + 26
    8   main                                0x000000000405de80 runtime.asmcgocall + 112
)
2016-09-17 17:25:32.636 main[2925:156856] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1259/Misc.subproj/NSUndoManager.m:359
2016-09-17 17:25:32.636 main[2925:156856] An uncaught exception was raised
2016-09-17 17:25:32.636 main[2925:156856] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2016-09-17 17:25:32.636 main[2925:156856] (
    0   CoreFoundation                      0x00007fff8802f4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8958373c objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff880341ca +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff90fef856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   Foundation                          0x00007fff90f74af1 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 170
    5   AppKit                              0x00007fff9319aebe -[NSApplication run] + 1000
    6   main                                0x0000000004356d30 nativeLoop + 128
    7   main                                0x00000000043566fa _cgo_8c6479959095_Cfunc_nativeLoop + 26
    8   main                                0x000000000405de80 runtime.asmcgocall + 112
)
2016-09-17 17:25:32.636 main[2925:156856] *** 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                      0x00007fff8802f4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8958373c objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff880341ca +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff90fef856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   Foundation                          0x00007fff90f74af1 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 170
    5   AppKit                              0x00007fff9319aebe -[NSApplication run] + 1000
    6   main                                0x0000000004356d30 nativeLoop + 128
    7   main                                0x00000000043566fa _cgo_8c6479959095_Cfunc_nativeLoop + 26
    8   main                                0x000000000405de80 runtime.asmcgocall + 112
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff97404f06 m=4
signal arrived during cgo execution

goroutine 21 [syscall, locked to thread]:
runtime.cgocall(0x43566e0, 0xc82004fe38, 0xc800000000)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/cgocall.go:123 +0x11b fp=0xc82004fe10 sp=0xc82004fde0
github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray._Cfunc_nativeLoop(0x0)
    github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray/_obj/_cgo_gotypes.go:76 +0x45 fp=0xc82004fe38 sp=0xc82004fe10
github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray.nativeLoop()
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray/systray_nonwindows.go:19 +0x18 fp=0xc82004fe48 sp=0xc82004fe38
github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray.Run(0x45954f8)
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray/systray.go:56 +0xa0 fp=0xc82004fe70 sp=0xc82004fe48
github.com/niels-s/alfa-drive/ui.RunSystrayMenu(0xc8200f2160, 0x45954e8, 0x45954e0)
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/ui/gui.go:20 +0x4c fp=0xc82004fe88 sp=0xc82004fe70
main.(*program).run(0x472dbe0)
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/main.go:77 +0x525 fp=0xc82004ff98 sp=0xc82004fe88
runtime.goexit()
    /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc82004ffa0 sp=0xc82004ff98
created by main.(*program).Start
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/main.go:47 +0x41

goroutine 25 [chan receive]:
github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray.Run.func1(0x45954f8)
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray/systray.go:52 +0x38
created by github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray.Run
    /Users/niels/workspace/go/src/github.com/niels-s/alfa-drive/vendor/github.com/getlantern/systray/systray.go:54 +0x9b

rax    0x0
rbx    0x6
rcx    0x700000185518
rdx    0x0
rdi    0xf03
rsi    0x6
rbp    0x700000185540
rsp    0x700000185518
r8     0x3
r9     0x7fff8e92ee4c
r10    0x8000000
r11    0x206
r12    0x7000001856a0
r13    0x601c020
r14    0x700000187000
r15    0x700000185580
rip    0x7fff97404f06
rflags 0x206
cs     0x7
fs     0x0
gs     0x0
exit status 2
@niels-s
Copy link
Author

niels-s commented Sep 23, 2016

Since my local env was busted anyway I've upgraded to macOS Sierra. So I rebuild all my dependencies and installed golang 1.7 which fixed everything again so thanks for the help anyway ;)

@rajkumarks7
Copy link

rajkumarks7 commented Jun 18, 2020

i am getting the above error when i have used runtime.LockOSThread() as the first statement it is still not working facing the same issue macoS Catalina version 10.15.5 and go version 1.14.4

@rajkumarks7
Copy link

@niels-s did you run systray.Run at the very beginning of main()? See https://github.com/getlantern/systray#usage. Or you can call runtime.LockOSThread() as the first statement in main().

it is not working when i am using the runtime.LockOSThread() in the first line of main() in the macoS Catalina version 10.15.5 with go version 1.14.4 with xcode 11.1 version can you please help me out with this one?

@rajkumarks7
Copy link

2020-06-18 20:49:02.823 workahub[2169:88946] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1676.105/Foundation/Misc.subproj/NSUndoManager.m:363
2020-06-18 20:49:02.825 workahub[2169:88946] *** 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 0x00007fff2f080be7 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff67e585bf objc_exception_throw + 48
2 CoreFoundation 0x00007fff2f0a9d98 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff31798e9d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 Foundation 0x00007fff316d55ee +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 440
5 AppKit 0x00007fff2c269e4c -[NSApplication run] + 864
6 workahub 0x0000000004691ea6 nativeLoop + 54
7 workahub 0x00000000046911ea _cgo_c2a8566d32ce_Cfunc_nativeLoop + 26
8 workahub 0x0000000004064750 runtime.asmcgocall + 112
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff6914733a m=7 sigcode=0

goroutine 0 [idle]:
runtime: unknown pc 0x7fff6914733a
stack: frame={sp:0x7000043c7578, fp:0x0} stack=[0x700004349350,0x7000043c8f50)
00007000043c7478: 0000000000000080 0000000000000080
00007000043c7488: 00007000043c78d0 0000000000000000
00007000043c7498: 0000000005610000 00007000043c74d0
00007000043c74a8: 00007000043c74e0 0000000000000080
00007000043c74b8: 0000000000000000 0000000032aaaba2

@rajkumarks7
Copy link

the systray was working fine in both the windows and linux with my code but getting the above error when i was running the program in the macos

@rajkumarks7
Copy link

@niels-s did you run systray.Run at the very beginning of main()? See https://github.com/getlantern/systray#usage. Or you can call runtime.LockOSThread() as the first statement in main().
hey i shared my error here can you help me with this one?

@joesis joesis reopened this Jun 21, 2020
@rajkumarks7
Copy link

I need to try it once

@rajkumarks7
Copy link

@rajkumarks7 does the example work for you on macOS? Or could you try if #157 can work in your situation?

i tried above solution but it is not working.

@rajkumarks7
Copy link

@rajkumarks7 does the example work for you on macOS? Or could you try if #157 can work in your situation?

i am getting the same error

meinto pushed a commit to meinto/cntr that referenced this issue Oct 16, 2020
@getlantern getlantern deleted a comment from joesis Mar 1, 2021
@getlantern getlantern deleted a comment from joesis Mar 1, 2021
@getlantern getlantern deleted a comment from joesis Mar 1, 2021
bdwyertech pushed a commit to bdwyertech/systray that referenced this issue Dec 19, 2022
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