danvergara / dblab

The database client every command line junkie deserves.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fatal panic in dblab 0.13.0 when compiled with Go 1.17.3 on x86_64 macOS

herbygillot opened this issue · comments

Describe the bug
When dblab is compiled with Go 1.17.3 on Darwin on an x86_64 platform, it panics on startup.

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

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6c1cf70a
stack: frame={sp:0x7ffeefbff5f8, fp:0x7ffeefbff648} stack=[0x7ffeefb80698,0x7ffeefbff700)
0x00007ffeefbff4f8:  0x01007ffeefbff518  0x0000000000000004 
0x00007ffeefbff508:  0x000000000000001f  0x00007fff6c1cf70a 
0x00007ffeefbff518:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff528:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff538:  0x00000000045fa820  0x00007ffeefbff580 
0x00007ffeefbff548:  0x0000000004038b88 <runtime.fatalthrow.func1+0x0000000000000048>  0x00000000049e3720 
0x00007ffeefbff558:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff568:  0x00007ffeefbff5c8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff578:  0x00000000049e3720  0x00007ffeefbff5b8 
0x00007ffeefbff588:  0x0000000004038b10 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff598 
0x00007ffeefbff598:  0x0000000004038b40 <runtime.fatalthrow.func1+0x0000000000000000>  0x00000000049e3720 
0x00007ffeefbff5a8:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff5b8:  0x00007ffeefbff5e8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff5c8:  0x00007ffeefbff5d0  0x0000000004038900 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff5d8:  0x0000000004601a8b  0x000000000000002a 
0x00007ffeefbff5e8:  0x00007ffeefbff638  0x000000000404e3f6 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff5f8: <0x0000000004601a8b  0x00000000049e3720 
0x00007ffeefbff608:  0x00007ffeefbff678  0x000000000402b666 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff618:  0x000000c00020e000  0x0000000000008000 
0x00007ffeefbff628:  0x00007fff00000008  0x0000000000000000 
0x00007ffeefbff638:  0x00007ffeefbff680 !0x00007fff6c1cf70a 
0x00007ffeefbff648: >0x00007ffeefbff680  0x0000000004938000 
0x00007ffeefbff658:  0x000000000000059a  0x00000000042cd365 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff668:  0x000000000406aa3f <runtime.syscall+0x000000000000001f>  0x000000c0001cb848 
0x00007ffeefbff678:  0x00007ffeefbff6c0  0x000000c0001cb818 
0x00007ffeefbff688:  0x00000000040688b0 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000004 
0x00007ffeefbff698:  0x0000000004018700 <runtime.evacuate_faststr+0x0000000000000220>  0x8700000000001018 
0x00007ffeefbff6a8:  0x0000000000000010  0x0000000004a17e78 
0x00007ffeefbff6b8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff6c8:  0x00000000040669c9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff6d8:  0x0000000004687060  0x00000000049e3720 
0x00007ffeefbff6e8:  0x00007ffeefbff738  0x00000000040668c5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff6f8:  0x000000000406687d <runtime.rt0_go+0x000000000000013d> 
runtime.throw({0x4601a8b, 0x49e3720})
	/opt/macports-test/lib/go/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6c1cf70a
stack: frame={sp:0x7ffeefbff5f8, fp:0x7ffeefbff648} stack=[0x7ffeefb80698,0x7ffeefbff700)
0x00007ffeefbff4f8:  0x01007ffeefbff518  0x0000000000000004 
0x00007ffeefbff508:  0x000000000000001f  0x00007fff6c1cf70a 
0x00007ffeefbff518:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff528:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff538:  0x00000000045fa820  0x00007ffeefbff580 
0x00007ffeefbff548:  0x0000000004038b88 <runtime.fatalthrow.func1+0x0000000000000048>  0x00000000049e3720 
0x00007ffeefbff558:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff568:  0x00007ffeefbff5c8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff578:  0x00000000049e3720  0x00007ffeefbff5b8 
0x00007ffeefbff588:  0x0000000004038b10 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff598 
0x00007ffeefbff598:  0x0000000004038b40 <runtime.fatalthrow.func1+0x0000000000000000>  0x00000000049e3720 
0x00007ffeefbff5a8:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff5b8:  0x00007ffeefbff5e8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff5c8:  0x00007ffeefbff5d0  0x0000000004038900 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff5d8:  0x0000000004601a8b  0x000000000000002a 
0x00007ffeefbff5e8:  0x00007ffeefbff638  0x000000000404e3f6 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff5f8: <0x0000000004601a8b  0x00000000049e3720 
0x00007ffeefbff608:  0x00007ffeefbff678  0x000000000402b666 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff618:  0x000000c00020e000  0x0000000000008000 
0x00007ffeefbff628:  0x00007fff00000008  0x0000000000000000 
0x00007ffeefbff638:  0x00007ffeefbff680 !0x00007fff6c1cf70a 
0x00007ffeefbff648: >0x00007ffeefbff680  0x0000000004938000 
0x00007ffeefbff658:  0x000000000000059a  0x00000000042cd365 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff668:  0x000000000406aa3f <runtime.syscall+0x000000000000001f>  0x000000c0001cb848 
0x00007ffeefbff678:  0x00007ffeefbff6c0  0x000000c0001cb818 
0x00007ffeefbff688:  0x00000000040688b0 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000004 
0x00007ffeefbff698:  0x0000000004018700 <runtime.evacuate_faststr+0x0000000000000220>  0x8700000000001018 
0x00007ffeefbff6a8:  0x0000000000000010  0x0000000004a17e78 
0x00007ffeefbff6b8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff6c8:  0x00000000040669c9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff6d8:  0x0000000004687060  0x00000000049e3720 
0x00007ffeefbff6e8:  0x00007ffeefbff738  0x00000000040668c5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff6f8:  0x000000000406687d <runtime.rt0_go+0x000000000000013d> 
runtime.sigpanic()
	/opt/macports-test/lib/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
syscall.syscall(0x42cd360, 0x1, 0x40487413, 0xc0001cb8d8)
	/opt/macports-test/lib/go/src/runtime/sys_darwin.go:22 +0x3b fp=0xc0001cb848 sp=0xc0001cb828 pc=0x40655db
syscall.syscall(0x40a9ca6, 0x4012514, 0xc0001cb900, 0x40a9bd8)
	<autogenerated>:1 +0x26 fp=0xc0001cb890 sp=0xc0001cb848 pc=0x406b246
golang.org/x/sys/unix.ioctl(0x45ea62d, 0x4, 0x1000000000008)
	/Users/hgillot/go/pkg/mod/golang.org/x/sys@v0.0.0-20210119212857-b64e53b001e4/unix/zsyscall_darwin_amd64.go:689 +0x39 fp=0xc0001cb8c0 sp=0xc0001cb890 pc=0x42ccff9
golang.org/x/sys/unix.IoctlGetTermios(...)
	/Users/hgillot/go/pkg/mod/golang.org/x/sys@v0.0.0-20210119212857-b64e53b001e4/unix/ioctl.go:72
github.com/mattn/go-isatty.IsTerminal(0x45ea62d)
	/Users/hgillot/go/pkg/mod/github.com/mattn/go-isatty@v0.0.12/isatty_bsd.go:10 +0x50 fp=0xc0001cb930 sp=0xc0001cb8c0 pc=0x42cd470
github.com/fatih/color.init()
	/Users/hgillot/go/pkg/mod/github.com/fatih/color@v1.10.0/color.go:21 +0x7a fp=0xc0001cb968 sp=0xc0001cb930 pc=0x42cdc5a
runtime.doInit(0x4941200)
	/opt/macports-test/lib/go/src/runtime/proc.go:6498 +0x123 fp=0xc0001cbaa0 sp=0xc0001cb968 pc=0x4048063
runtime.doInit(0x49411a0)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbbd8 sp=0xc0001cbaa0 pc=0x4047fb1
runtime.doInit(0x493e300)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbd10 sp=0xc0001cbbd8 pc=0x4047fb1
runtime.doInit(0x4941b00)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbe48 sp=0xc0001cbd10 pc=0x4047fb1
runtime.doInit(0x493c780)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbf80 sp=0xc0001cbe48 pc=0x4047fb1
runtime.main()
	/opt/macports-test/lib/go/src/runtime/proc.go:238 +0x1e6 fp=0xc0001cbfe0 sp=0xc0001cbf80 pc=0x403af26
runtime.goexit()
	/opt/macports-test/lib/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0001cbfe8 sp=0xc0001cbfe0 pc=0x4068ba1

To Reproduce
Steps to reproduce the behavior:

  1. Ensure running macOS on an x86_64 Intel host
  2. Ensure Go is version 1.17+
  3. Checkout dblab and switch to v0.13.0 branch
  4. make build
  5. Attempt to run dblab

Expected behavior
dblab runs normally.

OS (please complete the following information):

  • macOS Catalina 10.15.7, Intel x85_64

Additional context

  • Go 1.17.3

@herbygillot Sorry for the delayed response. I just added a small fix to the make command. Hope that may solve your problem. One question. Have you tried installing the compiled binary in the release section?

So I just rebuilt v0.13.0 with Go 1.17.5, and it's working fine, oddly enough.

Per your question about using the release binary, I am making dblab available in MacPorts. If you're not familiar, you can think of MacPorts as a package manager for macOS. It's an alternative to Homebrew. Using MacPorts, you can install all types of software.

Here's the info for dblab on MacPorts: https://ports.macports.org/port/dblab/

MacPorts prefers to build its software from source where possible, hence why we aren't using the release binary.

So I just rebuilt v0.13.0 with Go 1.17.5, and it's working fine, oddly enough.

Per your question about using the release binary, I am making dblab available in MacPorts. If you're not familiar, you can think of MacPorts as a package manager for macOS. It's an alternative to Homebrew. Using MacPorts, you can install all types of software.

Here's the info for dblab on MacPorts: https://ports.macports.org/port/dblab/

MacPorts prefers to build its software from source where possible, hence why we aren't using the release binary.

That was odd, maybe that happened because of a bug in that version and probably fixed in 1.17.5.

I didn't know what MacPorts was. Thanks, that's awesome, Thanks for making dblab available on MacPorts. Wondering if you wanna add some sort of automated task to release the newer versions to MacPorts, in the repository. Currently, I use Github Actions with goreleaser, but not sure if goreleaser has support for MacPorts.

Unfortunately that's one weak point with MacPorts, it isn't easy to automate just yet. Updates to dblab's port would be done as PRs against its Portfile: https://github.com/macports/macports-ports/blob/master/databases/dblab/Portfile

There are not yet really comprehensive turn-key tools for automatically updating and testing Portfiles just yet.

Also closing this issue as dblab seems to be working OK now.