Skip to content

nil pointer deref when using dispatch #48

@Le0Developer

Description

@Le0Developer

Getting a nil pointer deref here:

f()

I have no idea how to reproduce this, I've been getting this for months randomly and I can't narrow it down or reproduce consistently.

We use webview.Dispatch to evaluate code that sends RPC responses to JS land (we built our own RPC ontop of webview RPC because we needed async procedures).
This works without issues 99.999% of time, until it doesn't and crashes.

According to our observations, this might be related to navigations? We do "reloadless" navigations in our SPA and crashes seem to happen frequently imminently before/after one.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ff62432dbcd]

goroutine 1 [running, locked to thread]:
github.com/webview/webview_go._webviewDispatchGoCallback(0xc8)
        C:/Users/runneradmin/go/pkg/mod/github.com/webview/webview_go@v0.0.0-20230901181450-5a14030a9070/webview.go:217 +0xad
github.com/webview/webview_go._Cfunc_webview_run(0x15d0933d130)
        _cgo_gotypes.go:238 +0x49
github.com/webview/webview_go.(*webview).Run.func1(0xc00009fcb8?)
        C:/Users/runneradmin/go/pkg/mod/github.com/webview/webview_go@v0.0.0-20230901181450-5a14030a9070/webview.go:157 +0x34
github.com/webview/webview_go.(*webview).Run(0xc00007e630?)
        C:/Users/runneradmin/go/pkg/mod/github.com/webview/webview_go@v0.0.0-20230901181450-5a14030a9070/webview.go:157 +0x13
// .... our code that just calls Run

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions