]>
git.proxmox.com Git - mirror_frr.git/blob - tests/lib/test_segv.c
2 * SEGV / backtrace handling test.
4 * copied from test-sig.c
6 * Copyright (C) 2013 by David Lamparter, Open Source Routing.
7 * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
9 * This file is part of Quagga
11 * Quagga is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2, or (at your option) any
16 * Quagga is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; see the file COPYING; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #include "lib/memory.h"
31 struct quagga_signal_t sigs
[] = {};
33 struct thread_master
*master
;
45 static void func2(size_t depth
, int *arg
)
47 /* variable stack frame size */
49 for (size_t i
= 0; i
< depth
; i
++)
52 func2(depth
- 1, buf
);
55 for (size_t i
= 0; i
< depth
; i
++)
65 static int threadfunc(struct thread
*thread
)
73 master
= thread_master_create(NULL
);
74 signal_init(master
, array_size(sigs
), sigs
);
76 zlog_aux_init("NONE: ", LOG_DEBUG
);
78 thread_execute(master
, threadfunc
, 0, 0);