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

Doesn't work on macos #1

Open
jrwren opened this issue Dec 23, 2018 · 2 comments
Open

Doesn't work on macos #1

jrwren opened this issue Dec 23, 2018 · 2 comments

Comments

@jrwren
Copy link

jrwren commented Dec 23, 2018

a manual run with prefix=/usr/local

install -m 644 gsettings/org.d2r2.gorsync.gschema.xml ${PREFIX}/share/glib-2.0/schemas/
glib-compile-schemas ${PREFIX}/share/glib-2.0/schemas/

results in uncaught exception

$ ./gorsync_run.sh
Dev in progress...
2018-12-23 15:25:34.274 gorsync[91655:115327060] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff409b5e65 __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff6ca0c720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff409cf8e5 -[NSException raise] + 9
	3   AppKit                              0x00007fff3ded47e6 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 324
	4   AppKit                              0x00007fff3ded1bd0 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1488
	5   AppKit                              0x00007fff3ded15fa -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
	6   AppKit                              0x00007fff3e1a47d8 -[NSWindow initWithContentRect:styleMask:backing:defer:screen:] + 52
	7   libgdk-3.0.dylib                    0x0000000005c9a440 -[GdkQuartzNSWindow initWithContentRect:styleMask:backing:defer:screen:] + 79
	8   libgdk-3.0.dylib                    0x0000000005ca49f8 _gdk_quartz_display_create_window_impl + 1098
	9   libgdk-3.0.dylib                    0x0000000005c89851 gdk_window_new + 1035
	10  libgtk-3.0.dylib                    0x00000000058cabd9 gtk_window_realize + 1026
	11  libgtk-3.0.dylib                    0x000000000567ef23 gtk_application_window_real_realize + 96
	12  libgobject-2.0.0.dylib              0x0000000006005b2d g_closure_invoke + 200
	13  libgobject-2.0.0.dylib              0x0000000006018c67 signal_emit_unlocked_R + 1057
	14  libgobject-2.0.0.dylib              0x0000000006019a38 g_signal_emit_valist + 1828
	15  libgobject-2.0.0.dylib              0x000000000601a104 g_signal_emit + 120
	16  libgtk-3.0.dylib                    0x00000000058adc0d gtk_widget_realize + 337
	17  libgtk-3.0.dylib                    0x00000000058ca361 gtk_window_show + 81
	18  libgobject-2.0.0.dylib              0x0000000006005b2d g_closure_invoke + 200
	19  libgobject-2.0.0.dylib              0x0000000006018c67 signal_emit_unlocked_R + 1057
	20  libgobject-2.0.0.dylib              0x0000000006019a38 g_signal_emit_valist + 1828
	21  libgobject-2.0.0.dylib              0x000000000601a104 g_signal_emit + 120
	22  libgtk-3.0.dylib                    0x00000000058ad52f gtk_widget_show + 152
	23  gorsync                             0x00000000040598d0 runtime.asmcgocall + 112
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff6dc19b86 m=4 sigcode=0
signal arrived during cgo execution

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x455f490, 0xc00046f6d8, 0x68522a0)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/cgocall.go:128 +0x5e fp=0xc00046f6a8 sp=0xc00046f670 pc=0x40058fe
github.com/d2r2/gotk3/gtk._Cfunc_gtk_widget_show_all(0x68522a0)
	_cgo_gotypes.go:25763 +0x41 fp=0xc00046f6d8 sp=0xc00046f6a8 pc=0x43b0701
github.com/d2r2/gotk3/gtk.(*Widget).ShowAll.func1(0x68522a0)
	/Users/jrwren/go/src/github.com/d2r2/gotk3/gtk/base.go:209 +0x56 fp=0xc00046f710 sp=0xc00046f6d8 pc=0x43fe7e6
github.com/d2r2/gotk3/gtk.(*Widget).ShowAll(0xc0003de680)
	/Users/jrwren/go/src/github.com/d2r2/gotk3/gtk/base.go:209 +0x39 fp=0xc00046f730 sp=0xc00046f710 pc=0x43bb269
github.com/d2r2/go-rsync/ui/gtkui.CreateApp.func1(0xc0003de620)
	/Users/jrwren/go/src/github.com/d2r2/go-rsync/ui/gtkui/app.go:1338 +0x1c5 fp=0xc00046f7c0 sp=0xc00046f730 pc=0x4553745
runtime.call32(0xc0001e84b0, 0xc0001e64a0, 0xc000374440, 0x800000008)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:522 +0x3b fp=0xc00046f7f0 sp=0xc00046f7c0 pc=0x405843b
reflect.Value.call(0x45ea940, 0xc0001e64a0, 0x13, 0x46eed7f, 0x4, 0xc0001e64c0, 0x1, 0x1, 0xc0003de620, 0x0, ...)
	/usr/local/Cellar/go/1.11/libexec/src/reflect/value.go:447 +0x449 fp=0xc00046fab8 sp=0xc00046f7f0 pc=0x40b14c9
reflect.Value.Call(0x45ea940, 0xc0001e64a0, 0x13, 0xc0001e64c0, 0x1, 0x1, 0xc0003de620, 0x16, 0x0)
	/usr/local/Cellar/go/1.11/libexec/src/reflect/value.go:308 +0xa4 fp=0xc00046fb20 sp=0xc00046fab8 pc=0x40b0f64
github.com/d2r2/gotk3/glib.goMarshal(0x663c310, 0x0, 0xc000000001, 0x700008d33ac0, 0x700008d33a38, 0x0)
	/Users/jrwren/go/src/github.com/d2r2/gotk3/glib/glib.go:235 +0x714 fp=0xc00046fca0 sp=0xc00046fb20 pc=0x4331fb4
github.com/d2r2/gotk3/glib._cgoexpwrap_87e1bd86b6d4_goMarshal(0x663c310, 0x0, 0x1, 0x700008d33ac0, 0x700008d33a38, 0x0)
	_cgo_gotypes.go:6129 +0x5b fp=0xc00046fce0 sp=0xc00046fca0 pc=0x432f52b
runtime.call64(0x0, 0x700008d33860, 0x700008d338f8, 0x30)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:523 +0x3b fp=0xc00046fd30 sp=0xc00046fce0 pc=0x40584bb
runtime.cgocallbackg1(0x0)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/cgocall.go:316 +0x19b fp=0xc00046fda8 sp=0xc00046fd30 pc=0x4005c9b
runtime.cgocallbackg(0x0)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/cgocall.go:194 +0xd6 fp=0xc00046fe10 sp=0xc00046fda8 pc=0x4005a66
runtime.cgocallback_gofunc(0x4005922, 0x4577090, 0xc00046fea8, 0xc00046fe78)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:775 +0x9b fp=0xc00046fe30 sp=0xc00046fe10 pc=0x4059a0b
runtime.asmcgocall(0x4577090, 0xc00046fea8)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:622 +0x42 fp=0xc00046fe38 sp=0xc00046fe30 pc=0x40598a2
runtime.cgocall(0x4577090, 0xc00046fea8, 0x29)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/cgocall.go:131 +0x82 fp=0xc00046fe70 sp=0xc00046fe38 pc=0x4005922
github.com/d2r2/gotk3/glib._Cfunc_g_application_run(0x80110e0, 0x0, 0x66372b0, 0x0)
	_cgo_gotypes.go:1386 +0x4d fp=0xc00046fea8 sp=0xc00046fe70 pc=0x432679d
github.com/d2r2/gotk3/glib.(*Application).Run.func4(0x80110e0, 0x0, 0x66372b0, 0x0)
	/Users/jrwren/go/src/github.com/d2r2/gotk3/glib/application.go:194 +0x97 fp=0xc00046fee0 sp=0xc00046fea8 pc=0x433e527
github.com/d2r2/gotk3/glib.(*Application).Run(0xc00032f960, 0xc00046ff60, 0x0, 0x0, 0x0)
	/Users/jrwren/go/src/github.com/d2r2/gotk3/glib/application.go:194 +0x13b fp=0xc00046ff30 sp=0xc00046fee0 pc=0x4330d8b
main.main()
	/Users/jrwren/go/src/github.com/d2r2/go-rsync/gorsync.go:44 +0x30d fp=0xc00046ff98 sp=0xc00046ff30 pc=0x455d04d
runtime.main()
	/usr/local/Cellar/go/1.11/libexec/src/runtime/proc.go:201 +0x207 fp=0xc00046ffe0 sp=0xc00046ff98 pc=0x402e937
runtime.goexit()
	/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc00046ffe8 sp=0xc00046ffe0 pc=0x405a131

goroutine 20 [syscall]:
os/signal.signal_recv(0x0)
	/usr/local/Cellar/go/1.11/libexec/src/runtime/sigqueue.go:139 +0x9f
os/signal.loop()
	/usr/local/Cellar/go/1.11/libexec/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
	/usr/local/Cellar/go/1.11/libexec/src/os/signal/signal_unix.go:29 +0x41

rax    0x0
rbx    0x700008d34000
rcx    0x700008d314e8
rdx    0x0
rdi    0x2803
rsi    0x6
rbp    0x700008d31520
rsp    0x700008d314e8
r8     0x700008d313a8
r9     0x700008d31580
r10    0x0
r11    0x206
r12    0x2803
r13    0x3000000008
r14    0x6
r15    0x2d
rip    0x7fff6dc19b86
rflags 0x206
cs     0x7
fs     0x0
gs     0x0
@d2r2
Copy link
Owner

d2r2 commented Dec 23, 2018

Hi @jrwren! Honestly, I never try to make it running on macOS, perhaps because my main goal to run and debug it on Linux platform first. I hope finally do this, but do not promise that in nearest days. Thanks for reporting this issue, will think how to solve this problem.

@thepaul
Copy link

thepaul commented Jan 20, 2022

I haven't tried go-rsync, but I think I've been able to work around this problem in gotk3 by calling runtime.LockOSThread() in the main goroutine (the one that calls gtk.Init() and other gtk calls later). As long as the calls all come from the same OS thread, macOS seems happy.

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

No branches or pull requests

3 participants