ultralight-ux / Ultralight

Lightweight, high-performance HTML renderer for game and app developers.
https://ultralig.ht
4.69k stars 196 forks source link

Crash when using new 1.2.beta.2 #307

Closed jonatino closed 4 years ago

jonatino commented 4 years ago

I'm using muon and upgrade 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/muon@v0.0.0-20201025091847-2734619fe28a/ultralight/ultralight.go:84 +0x80
github.com/Jonatino/muon/ultralight.UlCreateApp(0x174c2a0, 0x1724cd0, 0x0)
    C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/muon@v0.0.0-20201025091847-2734619fe28a/ultralight/ultralight.go:84 +0x48
github.com/Jonatino/muon.New(0xc0000b4f30, 0x90e260, 0xc000088c80, 0xc0000b4f00)
    C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/muon@v0.0.0-20201025091847-2734619fe28a/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
}
SupinePandora43 commented 4 years ago

You need to know, Ultralight supports only c++, c api. Anything else is only binding for some language (currently [java,csharp,rust,go])

If Ultralight's samples not crashes on your PC, it's probably problem with Go binding for Ultralight.

jonatino commented 4 years ago

@SupinePandora43 yeah I just posted it here as I don't really have much information in terms of whats going on since its just a raw exception dump from Ultralight itself.

adamjs commented 4 years ago

The maintainer needs to update to our latest API, the C function signatures changed between releases, hence the crash.

We just released 1.2 stable (today!), so now is a good time to update the bindings. 8)