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