Skip to content

Instantly share code, notes, and snippets.

@bwester
bwester / exec-deadlock.stack
Created April 15, 2022 04:28
Stack dump of exec-deadlock.go when it has deadlocked.
Compile environment: CGO_ENABLED=0
Compiled with go1.18.1 .tar.gz release for darwin/amd64
Run on darwin/amd64 (macOS 11.6.5)
Output obtained from a dlv debugging session:
============================================================
(dlv) goroutines
Goroutine 1 - User: /opt/go1.18.1/src/runtime/os_darwin.go:348 syscall.runtime_BeforeExec (0x1058dd3)
Goroutine 2 - User: /opt/go1.18.1/src/runtime/proc.go:362 runtime.gopark (0x1031fb6) [force gc (idle)]
Goroutine 3 - User: /opt/go1.18.1/src/runtime/proc.go:362 runtime.gopark (0x1031fb6) [finalizer wait]
@bwester
bwester / exec-deadlock.go
Created April 15, 2022 04:27
A minimal Go program that can cause a deadlock in the Exec call. Compile with CGO_ENABLED=0. Tested on macOS 11.6.5, go1.18.1 darwin/amd64.
package main
import (
"log"
"os"
"os/signal"
"syscall"
)
func main() {
@bwester
bwester / deadlock-hermit-0.18.3-go-db7183ccf9.txt
Created April 11, 2022 15:55
DLV and SIGQUIT info for Hermit, built with Go @ db7183ccf9, when it has deadlocked
Hermit v0.18.3 (Square internal wrapper)
compile environment: CGO_ENABLED=0
compiled with Go @ db7183ccf9
run environment: GOTRACEBACK=crash
arch: amd64
os: darwin (macOS 11.6.3)
output 1: DLV session attached to the deadlocked process
output 2: output after receiving SIGQUIT
------------------------------
@bwester
bwester / hermit-crash.txt
Created April 8, 2022 23:21
The output generated by pressing Ctrl-\ for a Hermit process after it has locked up — OS: macOS 11.6.3 — arch: amd64 — Hermit version: v0.18.3 — Hermit built with: go1.17.7
^\SIGQUIT: quit
PC=0x7fff20376cde m=0 sigcode=0
goroutine 0 [idle]:
runtime.pthread_cond_wait(0x14b5e20, 0x14b5de0)
/usr/local/opt/go/libexec/src/runtime/sys_darwin.go:444 +0x34 fp=0x7ffeefbfe6e8 sp=0x7ffeefbfe6c0 pc=0x1051094
runtime.semasleep(0xffffffffffffffff)
/usr/local/opt/go/libexec/src/runtime/os_darwin.go:66 +0xad fp=0x7ffeefbfe740 sp=0x7ffeefbfe6e8 pc=0x102e44d
runtime.notesleep(0x14b5bd0)
/usr/local/opt/go/libexec/src/runtime/lock_sema.go:182 +0x85 fp=0x7ffeefbfe770 sp=0x7ffeefbfe740 pc=0x100aea5
@bwester
bwester / gist:25f9ecbe3c8b0fe888b9
Created April 6, 2015 15:58
Public key announcement
### Keybase proof
I hereby claim:
* I am bwester on github.
* I am bwester (https://keybase.io/bwester) on keybase.
* I have a public key whose fingerprint is C699 0BE1 D8BC 26B5 869D 831E B9D5 651A 2431 5C1F
To claim this, I am signing this object: