/
niceSOFT
/
systemd
Обзор
Документация
Войти
/
niceSOFT
/
systemd
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/test/test-coredump-stacktrace.c
29 строк
492 B
Frantisek Sumsal
test: build the crashing test binary outside of the test
11 окт 2025, 23:37
11 окт 2025, 23:37
937f609
Код
Авторство
О чём код?
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* This is a test program that intentionally segfaults so we can generate a * predictable-ish stack trace in tests. */ #include <stdlib.h> __attribute__((noinline)) static void baz(int *x) { *x = rand(); } __attribute__((noinline)) static void bar(void) { int * volatile x = NULL; baz(x); } __attribute__((noinline)) static void foo(void) { bar(); } int main(void) { foo(); return 0; }