hello2.go triggers panic: runtime error: invalid memory address or nil pointer dereference
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
$ go version
go version go1.23.3 linux/amd64
$ go run hello2.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x51c8fd]
goroutine 1 [running, locked to thread]:
modernc.org/tk9%2e0.winCollect(0xc0000a6550, {0xc0000be0c0?, 0xc0000cbda0?, 0x3?})
/home/ubuntu/goprojs/pkg/mod/modernc.org/tk9.0@v0.52.1/tk.go:401 +0x7d
modernc.org/tk9%2e0.(*Window).newChild(0x9ee130, {0x560f02, 0xb}, {0xc0000be080, 0x3, 0x532240?})
/home/ubuntu/goprojs/pkg/mod/modernc.org/tk9.0@v0.52.1/tk.go:364 +0x3eb
modernc.org/tk9%2e0.(*Window).TButton(...)
/home/ubuntu/goprojs/pkg/mod/modernc.org/tk9.0@v0.52.1/generated.go:2831
modernc.org/tk9%2e0.(*Window).TExit(0x9ee130, {0xc0000cbec8, 0x1, 0x4691ae?})
/home/ubuntu/goprojs/pkg/mod/modernc.org/tk9.0@v0.52.1/tk.go:1804 +0x117
modernc.org/tk9%2e0.TExit(...)
/home/ubuntu/goprojs/pkg/mod/modernc.org/tk9.0@v0.52.1/tk.go:1796
main.main()
/home/ubuntu/tmp/tk9/hello2.go:8 +0x50
exit status 2
X.Org X Server 1.21.1.11
X Protocol Version 11, Revision 0
Current Operating System: Linux xubuntu-vm 6.7.10-060710-generic #202403151538 SMP PREEMPT_DYNAMIC Fri Mar 15 20:14:18 UTC 2024 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.7.10-060710-generic root=/dev/mapper/xubuntu--vg-root ro noquiet nosplash hpet=disable
xorg-server 2:21.1.12-1ubuntu1.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.42.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Edited by Shelby Cain