about summary refs log tree commit diff
path: root/fail.1
blob: 8026683c777b49f846445565eac670030083e877 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.Dd January 11, 2019
.Dt FAIL 1
.Os
.Sh NAME
.Nm fail
.Nd crash in various possible ways
.Sh SYNOPSIS
.Nm
.Op Fl 123DORabcdikrst
.Sh DESCRIPTION
.Nm
crashes in various possible ways to
help you debug how other software reacts to this.
.Pp
In addition to the crashes below,
.Nm
will also cause a segmentation fault when its binary is loaded using
.Xr dlopen 3
or
.Ev LD_PRELOAD .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 1
Return with exit status -1.
.It Fl 2
Return with exit status 2.
.It Fl 3
Return with exit status 111.
.It Fl D
Create a process that is in uninterruptible sleep (state D) and
print its pid.
(This uses
.Xr vfork 2
and
.Xr pause 2 . )
.It Fl O
Allocate memory in an infinite loop,
to trigger an out of memory situation.
A dot is printed after each 16MB allocation.
.Sy Warning :
this may lock up your machine
and/or result in killing other processes, too.
Use with caution.
.It Fl R
Trigger an infinite recursion that uses
.Xr alloca 3
heavily
.Po
to test GCC's
.Fl fstack-clash-protection
.Pc .
.It Fl a
Call
.Xr abort 3 .
.It Fl b
Trigger SIGBUS by accessing
.Xr mmap 2
memory beyond the end of a file.
.It Fl c
Violate a
.Xr seccomp 2
strict mode restriction.
.It Fl d
Divide by zero.
.It Fl i
Execute an illegal instruction.
.It Fl k
Raise SIGKILL.
.It Fl r
Trigger an infinite recursion that uses less than a page of stack per level.
.It Fl s
Trigger a segmentation fault by writing to a null pointer.
.It Fl t
Trigger GCC's
.Fn __builtin_trap .
.El
.Sh EXIT STATUS
The
.Nm
utility never returns 0,
because failure is inevitable.
.Sh SEE ALSO
.Xr false 1 ,
.Xr seccomp 2 ,
.Xr abort 3
.Sh AUTHORS
.An Leah Neukirchen Aq Mt leah@vuxu.org
.Sh LICENSE
.Nm
is in the public domain.
.Pp
To the extent possible under law,
the creator of this work
has waived all copyright and related or
neighboring rights to this work.
.Pp
.Lk http://creativecommons.org/publicdomain/zero/1.0/