OpenDiablo2 / HellSpawner

The OpenDiablo2 toolset
GNU General Public License v3.0
153 stars 45 forks source link

Dialog causes crash on Lubuntu 20.04 LTS x64 #88

Closed gravestench closed 3 years ago

gravestench commented 3 years ago

This is being caused, likely, by GOTK3+

I've filed an issue with the maintainer of squeek: https://github.com/sqweek/dialog/issues/51

hey are not likely to fix this, so we will likely need to pull their code into our project.

            .-/+oossssoo+/-.               dk@pancake 
        `:+ssssssssssssssssss+:`           ---------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04.1 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: NUC6i7KYK H90755-112 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.4.0-58-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 4 days, 13 hours, 54 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2993 (dpkg), 10 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.0.17 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1920x1200, 1920x1200, 1200x1920 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: i3 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Theme: Arc-Darker [GTK3] 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Icons: Adwaita [GTK3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   CPU: Intel i7-6770HQ (8) @ 3.500GHz 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    GPU: Intel Iris Pro Graphics 580 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Memory: 11420MiB / 32005MiB 
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.                               
      -+sssssssssssssssssyyyssss+-                                 
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

Error log:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7f9dd917afc4]

runtime stack:
runtime.throw(0x74a89e, 0x2a)
        /usr/local/go/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:726 +0x4ac

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x6b7590, 0xc000161a60, 0x0)
        /usr/local/go/src/runtime/cgocall.go:133 +0x5b fp=0xc000161a30 sp=0xc0001619f8 pc=0x44f69b
github.com/sqweek/dialog._Cfunc_gtk_dialog_run(0x1c2a340, 0x0)
        _cgo_gotypes.go:239 +0x49 fp=0xc000161a60 sp=0xc000161a30 pc=0x60ef49
github.com/sqweek/dialog.runMsgDlg.func4(0x1c2a340, 0x1c71da0)
        /home/dk/.go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20200911184034-8a3d98e8211d/dlgs_linux.go:39 +0x4d fp=0xc000161a90 sp=0xc000161a60 pc=0x6103cd
github.com/sqweek/dialog.runMsgDlg(0x73b178, 0xb, 0x0, 0x1, 0xc000161b70, 0xc000000000)
        /home/dk/.go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20200911184034-8a3d98e8211d/dlgs_linux.go:39 +0x1a9 fp=0xc000161b28 sp=0xc000161a90 pc=0x60fa49
github.com/sqweek/dialog.(*MsgBuilder).info(...)
        /home/dk/.go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20200911184034-8a3d98e8211d/dlgs_linux.go:47
github.com/sqweek/dialog.(*MsgBuilder).Info(...)
        /home/dk/.go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20200911184034-8a3d98e8211d/dlgs.go:56
github.com/OpenDiablo2/HellSpawner/hsapp.(*App).renderMainMenuBar.func2()
        /home/dk/src/hellspawner-gravestench/hsapp/app.go:99 +0xfb fp=0xc000161ba0 sp=0xc000161b28 pc=0x61285b
github.com/AllenDang/giu.(*MenuItemWidget).Build(0xc0001c90a0)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/Widgets.go:876 +0x74 fp=0xc000161be0 sp=0xc000161ba0 pc=0x60b814
github.com/AllenDang/giu.Layout.Build(0xc0001c4ce0, 0x1, 0x1)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/Layout.go:11 +0x5a fp=0xc000161c08 sp=0xc000161be0 pc=0x609ada
github.com/AllenDang/giu.(*MenuWidget).Build(0xc0001ce2d0)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/Widgets.go:902 +0x85 fp=0xc000161c38 sp=0xc000161c08 pc=0x60b8a5
github.com/AllenDang/giu.Layout.Build(0xc000161d18, 0x3, 0x3)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/Layout.go:11 +0x5a fp=0xc000161c60 sp=0xc000161c38 pc=0x609ada
github.com/AllenDang/giu.(*MainMenuBarWidget).Build(0xc000161d00)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/Widgets.go:836 +0x68 fp=0xc000161c88 sp=0xc000161c60 pc=0x60b788
github.com/OpenDiablo2/HellSpawner/hsapp.(*App).renderMainMenuBar(0xc00007ced0)
        /home/dk/src/hellspawner-gravestench/hsapp/app.go:102 +0x3a6 fp=0xc000161d58 sp=0xc000161c88 pc=0x611dc6
github.com/OpenDiablo2/HellSpawner/hsapp.(*App).render(0xc00007ced0)
        /home/dk/src/hellspawner-gravestench/hsapp/app.go:49 +0x2f fp=0xc000161d88 sp=0xc000161d58 pc=0x61134f
github.com/OpenDiablo2/HellSpawner/hsapp.(*App).render-fm()
        /home/dk/src/hellspawner-gravestench/hsapp/app.go:48 +0x2a fp=0xc000161da0 sp=0xc000161d88 pc=0x61294a
github.com/AllenDang/giu.(*MasterWindow).render(0xc000159420)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MasterWindow.go:170 +0x96 fp=0xc000161e20 sp=0xc000161da0 pc=0x60acd6
github.com/AllenDang/giu.(*MasterWindow).run.func1()
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MasterWindow.go:189 +0x59 fp=0xc000161e60 sp=0xc000161e20 pc=0x60c2b9
github.com/AllenDang/giu.Call.func1()
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MainThread.go:67 +0x2f fp=0xc000161e90 sp=0xc000161e60 pc=0x60c22f
github.com/AllenDang/giu.Run(0xc00000e5e0)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MainThread.go:53 +0x72 fp=0xc000161ec8 sp=0xc000161e90 pc=0x60a092
github.com/AllenDang/giu.(*MasterWindow).Main(0xc000159420, 0xc00016bda0)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MasterWindow.go:236 +0x65 fp=0xc000161ee8 sp=0xc000161ec8 pc=0x60afe5
github.com/OpenDiablo2/HellSpawner/hsapp.(*App).Run(0xc00007ced0)
        /home/dk/src/hellspawner-gravestench/hsapp/app.go:45 +0xec fp=0xc000161f48 sp=0xc000161ee8 pc=0x6112ec
main.main()
        /home/dk/src/hellspawner-gravestench/main.go:16 +0x85 fp=0xc000161f88 sp=0xc000161f48 pc=0x6129e5
runtime.main()
        /usr/local/go/src/runtime/proc.go:204 +0x209 fp=0xc000161fe0 sp=0xc000161f88 pc=0x483dc9
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000161fe8 sp=0xc000161fe0 pc=0x4b4c01

goroutine 6 [chan receive]:
github.com/AllenDang/giu.Call(0xc0001ce210)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MainThread.go:68 +0xaa
github.com/AllenDang/giu.(*MasterWindow).run(0xc000159420)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MasterWindow.go:187 +0x74
github.com/AllenDang/giu.(*MasterWindow).Main.func1()
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MasterWindow.go:241 +0x4d
github.com/AllenDang/giu.Run.func1(0xc00000e5e0, 0xc0000720c0)
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MainThread.go:50 +0x27
created by github.com/AllenDang/giu.Run
        /home/dk/.go/pkg/mod/github.com/!allen!dang/giu@v0.4.2/MainThread.go:50 +0x6b
exit status 2

I'm pretty sure I have the dependencies met.

I've installed the following:

gravestench commented 3 years ago

Resolved by https://github.com/OpenDiablo2/dialog/pull/1

We ended up just forking from @sqweek and fixing the repo. It was some kind of threading issue.

The fix is here, where we call dialog.Init()

func (a *App) Run() {
    wnd := g.NewMasterWindow("HellSpawner", 1280, 720, 0, a.setupFonts)
    wnd.SetBgColor(color.RGBA{10, 10, 10, 255})

    sampleRate := beep.SampleRate(22050)
    if err := speaker.Init(sampleRate, sampleRate.N(time.Second/10)); err != nil {
        log.Fatal(err)
    }

    dialog.Init()

    wnd.Main(a.render)
}