Skip to content

golang programs crash with heavy goroutine scheduling #1932

@sporksmith

Description

@sporksmith

Broken out from #1549

This breaks in both ptrace and preload mode, though perhaps a bit more consistently in preload mode.

Example program:

package main

import (
    "fmt"
    "sync"
    "time"
)

func worker(wg *sync.WaitGroup, from int) {
    defer wg.Done()
    for i := 0; i < 10; i++ {
        fmt.Println("Worker:", from, " iteration:", i)
        time.Sleep(time.Second)
    }
}

func main() {
    var wg sync.WaitGroup
    for i := 0; i < 10; i++ {
      wg.Add(1)
      go worker(&wg, i)
    }
    wg.Wait()
    fmt.Println("done")
}
general:
  stop_time: 2000s

network:
  graph:
    type: 1_gbit_switch

hosts:
  host:
    network_node_id: 0
    processes:
    - path: ./test_goroutines
      start_time: 1s
      environment: GOMAXPROCS=2

The program often ends up exiting with exit code 139, indicating it was killed by signal 11 (SIGSEGV).

Metadata

Metadata

Assignees

Labels

Type: BugError or flaw producing unexpected results

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions