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

Crash when using new 1.2.beta.2 #48

Open
jonatino opened this issue Oct 26, 2020 · 3 comments
Open

Crash when using new 1.2.beta.2 #48

jonatino opened this issue Oct 26, 2020 · 3 comments

Comments

@jonatino
Copy link

jonatino commented Oct 26, 2020

I'm using muon and upgraded it to the new 1.2 dlls but it's crashing when calling ULCreateApp.

Stacktrace:

Exception 0x406d1388 0x1000 0x7ffbfa2294f8 0x7ffc558d3e49
PC=0x7ffc558d3e49

runtime: unknown pc 0x7ffc558d3e49
stack: frame={sp:0x15bed40, fp:0x0} stack=[0x0,0x15bfdc0)
00000000015bec40:  0000000000000000  0000000000000000 
00000000015bec50:  00007ffbfa5e14b0  00007ffbfa5e15e8 
00000000015bec60:  00000000015bee10  00007ffbf8db32d2 
00000000015bec70:  00000000000007d0  0000000000000007 
00000000015bec80:  00000000000007d0  00007ffbfa5e15e8 
00000000015bec90:  0000000000000000  00007ffbf8dba023 
00000000015beca0:  0000000000000001  41d7e5523262f2b4 
00000000015becb0:  00007ffbfa5e15e8  00007ffbf8e66251 
00000000015becc0:  000000000000000d  00007ffbf8dba001 
00000000015becd0:  00007ffbfa23b830  00007ffc5770f5a3 
00000000015bece0:  00007ffbfa23b830  00000000015bedf0 
00000000015becf0:  0000000000170120  00002008bca2043e 
00000000015bed00:  0000000000000000  00007ffc57bfac16 
00000000015bed10:  0000f84fc77b1203  0000000000100000 
00000000015bed20:  0000000000000001  00000000015befe0 
00000000015bed30:  00007ffbf8db5ee0  00007ffc558d3e49 
00000000015bed40: <00000000015bee10  0000000000000000 
00000000015bed50:  00007ffbfa5e14f0  0000000000000000 
00000000015bed60:  00000000406d1388  0000000000000000 
00000000015bed70:  00007ffc558d3e49  00007ffc00000003 
00000000015bed80:  0000000000001000  00007ffbfa2294f8 
00000000015bed90:  00000000000025c8  00007ffc3c62f530 
00000000015beda0:  0000000000000000  00000000001715c0 
00000000015bedb0:  00007ffbf8db5ee0  0000000000000001 
00000000015bedc0:  00007ffbfa5e15e8  00007ffbf8dba143 
00000000015bedd0:  00000000015bee70  00007ffbf8dbb0dd 
00000000015bede0:  00007ffbfa5e14f0  00007ffbfa5e15e8 
00000000015bedf0:  0000000000000000  0000000000000040 
00000000015bee00:  0000bb7244610403  000000010000000b 
00000000015bee10:  00007ffbf8db5ee0  00007ffbf8db59ea 
00000000015bee20:  0000000000000000  00007ffc57c06e2c 
00000000015bee30:  00000000015befe0  00007ffbf8dbae5a 
runtime: unknown pc 0x7ffc558d3e49
stack: frame={sp:0x15bed40, fp:0x0} stack=[0x0,0x15bfdc0)
00000000015bec40:  0000000000000000  0000000000000000 
00000000015bec50:  00007ffbfa5e14b0  00007ffbfa5e15e8 
00000000015bec60:  00000000015bee10  00007ffbf8db32d2 
00000000015bec70:  00000000000007d0  0000000000000007 
00000000015bec80:  00000000000007d0  00007ffbfa5e15e8 
00000000015bec90:  0000000000000000  00007ffbf8dba023 
00000000015beca0:  0000000000000001  41d7e5523262f2b4 
00000000015becb0:  00007ffbfa5e15e8  00007ffbf8e66251 
00000000015becc0:  000000000000000d  00007ffbf8dba001 
00000000015becd0:  00007ffbfa23b830  00007ffc5770f5a3 
00000000015bece0:  00007ffbfa23b830  00000000015bedf0 
00000000015becf0:  0000000000170120  00002008bca2043e 
00000000015bed00:  0000000000000000  00007ffc57bfac16 
00000000015bed10:  0000f84fc77b1203  0000000000100000 
00000000015bed20:  0000000000000001  00000000015befe0 
00000000015bed30:  00007ffbf8db5ee0  00007ffc558d3e49 
00000000015bed40: <00000000015bee10  0000000000000000 
00000000015bed50:  00007ffbfa5e14f0  0000000000000000 
00000000015bed60:  00000000406d1388  0000000000000000 
00000000015bed70:  00007ffc558d3e49  00007ffc00000003 
00000000015bed80:  0000000000001000  00007ffbfa2294f8 
00000000015bed90:  00000000000025c8  00007ffc3c62f530 
00000000015beda0:  0000000000000000  00000000001715c0 
00000000015bedb0:  00007ffbf8db5ee0  0000000000000001 
00000000015bedc0:  00007ffbfa5e15e8  00007ffbf8dba143 
00000000015bedd0:  00000000015bee70  00007ffbf8dbb0dd 
00000000015bede0:  00007ffbfa5e14f0  00007ffbfa5e15e8 
00000000015bedf0:  0000000000000000  0000000000000040 
00000000015bee00:  0000bb7244610403  000000010000000b 
00000000015bee10:  00007ffbf8db5ee0  00007ffbf8db59ea 
00000000015bee20:  0000000000000000  00007ffc57c06e2c 
00000000015bee30:  00000000015befe0  00007ffbf8dbae5a 

goroutine 1 [syscall]:
github.com/Jonatino/muon/ultralight._Cfunc_ulCreateApp(0x174c2a0, 0x1724cd0, 0x0)
	_cgo_gotypes.go:3437 +0x55
github.com/Jonatino/muon/ultralight.UlCreateApp.func1(0x174c2a0, 0x1724cd0, 0xc0000c7ea0)
	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/ultralight/ultralight.go:84 +0x80
github.com/Jonatino/muon/ultralight.UlCreateApp(0x174c2a0, 0x1724cd0, 0x0)
	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/ultralight/ultralight.go:84 +0x48
github.com/Jonatino/muon.New(0xc0000b4f30, 0x90e260, 0xc000088c80, 0xc0000b4f00)
	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/muon.go:74 +0xdb
main.main()
	E:/Sync/Insignia/launcher/Launcher.go:33 +0x134
rax     0x0
rbx     0x0
rcx     0x0
rdi     0x15befe0
rsi     0x7ffbfa5e14f0
rbp     0x7ffbf8db5ee0
rsp     0x15bed40
r8      0x0
r9      0x0
r10     0x0
r11     0x0
r12     0x174c1e0
r13     0x0
r14     0x1
r15     0x7ffbf8db5ee0
rip     0x7ffc558d3e49
rflags  0x202
cs      0x33
fs      0x53
gs      0x2b

Main method

// New creates a Ultralight Window
func New(cfg *Config, handler http.Handler) *Window {
	w := &Window{
		cfg:       cfg,
		handler:   handler,
		callbacks: make(map[string]*ipf),
	}

	ufg := UlCreateConfig()

	log := func(log_level ULLogLevel, message ULString) {
		fmt.Println(message)
	}

	logger := ULLogger{
		Log_message: log,
	}

	UlPlatformSetLogger(logger)
	
	resourcePath := UlCreateString("./resources/")
	defer UlDestroyString(resourcePath)
	UlConfigSetResourcePath(ufg, resourcePath)

	cachePath := UlCreateString("./cache/")
	defer UlDestroyString(cachePath)
	UlConfigSetCachePath(ufg, cachePath)

	std := UlCreateSettings()
	w.app = UlCreateApp(std, ufg)
	mm := UlAppGetMainMonitor(w.app)

	var hint uint32

	if cfg.Resizeable {
		hint |= 4
	}

	if cfg.Borderless {
		hint |= 1
	}

	if cfg.Titled {
		hint |= 2
	} else {
		w.cfg.Title = ""
	}

	if cfg.Maximizable {
		hint |= 8
	}

	w.wnd = UlCreateWindow(mm, w.cfg.Width, w.cfg.Height, false, hint)

	UlWindowSetTitle(w.wnd, w.cfg.Title)
	UlAppSetWindow(w.app, w.wnd)

	w.ov = UlCreateOverlay(w.wnd, w.cfg.Width, w.cfg.Height, w.cfg.X, w.cfg.Y)

	UlWindowSetResizeCallback(w.wnd, resizeCallback(w.ov), nil)

	w.view = UlOverlayGetView(w.ov)

	return w
}
@ImVexed
Copy link
Owner

ImVexed commented Oct 27, 2020

The signatures have likely changed, and the bindings will have to be updated using https://github.com/xlab/c-for-go

@jonatino
Copy link
Author

jonatino commented Oct 27, 2020

@ImVexed yeah I did all that and they have changed a bit how the SDK is laid out as well. Look liks all the javascript stuff has been moved out into its own dll now as well.

See https://github.com/Jonatino/muon

@jonatino
Copy link
Author

1.2 is officially released now. Might want to try and update muon if you have the time. I'll still keep trying to see if I can fix my branch but its the first time working with go/c interop.

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