lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.78k stars 886 forks source link

crash on old device: handleForDPIWithError #792

Open 5HARK opened 2 years ago

5HARK commented 2 years ago
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x6ca19d]

goroutine 1 [running, locked to thread]:
github.com/lxn/walk.(*Icon).handleForDPIWithError(0x0, 0x60, 0x12860b58, 0xeda56
0, 0x77d87000)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/icon.go:241 +0x1d
github.com/lxn/walk.(*Icon).handleForDPI(...)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/icon.go:236
github.com/lxn/walk.(*IconCache).Icon(0x12807348, 0xaa1060, 0x0, 0x60, 0x0, 0x0,
 0x9fa724)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/iconcache.go:76 +0x147
github.com/lxn/walk.IconFrom(0x97cd80, 0x0, 0x60, 0x4ad50a, 0x92a100, 0x14660e8)

        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/icon.go:48 +0x77
github.com/lxn/walk.(*FormBase).init.func2(0x97cd80, 0x0, 0x12904001, 0x0)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/form.go:118 +0x47
github.com/lxn/walk.(*property).Set(0x12902080, 0x97cd80, 0x0, 0x0, 0x0)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/property.go:65 +0x4d
github.com/lxn/walk/declarative.(*Builder).initProperties(0x12845380, 0x0, 0x99)

        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/declarative/builder.go:666 +0x318
github.com/lxn/walk/declarative.(*Builder).InitWidget(0x12845380, 0xa9b700, 0x12
80f320, 0xaa7d00, 0x1282af00, 0x12860fa8, 0x0, 0x0)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/declarative/builder.go:418 +0x91e
github.com/lxn/walk/declarative.MainWindow.Create(0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, ...)
        C:/Users/shark/go/pkg/mod/github.com/lxn/walk@v0.0.0-20191128110447-55cc
b3a9f5c1/declarative/mainwindow.go:120 +0x3dc
main.main()
        D:/pos-middleware-launcher/launcher.go:965 +0x1669

and it works when i use old walk version(https://github.com/lxn/walk/tree/3b9dbc29e91646ce796bdc2e0fbcdfaa769cc927). i found clue on issue #609

5HARK commented 2 years ago

Here is device info

image

info.txt