| Tim Windelschmidt | 18e9a3f | 2024-04-08 21:51:03 +0200 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| Tim Windelschmidt | d0dd1f5 | 2025-01-09 04:42:19 +0100 | [diff] [blame] | 4 | "context" |
| 5 | "os" |
| 6 | |
| Tim Windelschmidt | 18e9a3f | 2024-04-08 21:51:03 +0200 | [diff] [blame] | 7 | "source.monogon.dev/osbase/bringup" |
| 8 | ) |
| 9 | |
| 10 | func main() { |
| Tim Windelschmidt | d0dd1f5 | 2025-01-09 04:42:19 +0100 | [diff] [blame] | 11 | bringup.Runnable(func(ctx context.Context) error { |
| 12 | // Disable the exception tracing of the kernel which captures unhandled |
| 13 | // signals as it races with our logging which makes the test flaky. |
| 14 | err := os.WriteFile("/proc/sys/debug/exception-trace", []byte("0"), 0755) |
| 15 | if err != nil { |
| 16 | return err |
| 17 | } |
| 18 | |
| 19 | // Provoke a segfault, which produces a panic inside the root runnable |
| 20 | //nolint:nilness |
| 21 | _ = *(*string)(nil) |
| 22 | return nil |
| 23 | }).Run() |
| Tim Windelschmidt | 18e9a3f | 2024-04-08 21:51:03 +0200 | [diff] [blame] | 24 | } |