about summary refs log tree commit diff
path: root/fail.1
blob: d63ea574d63a40224047563e2b7ecfbc96b1fe35 (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
.Dd July 14, 2017
.Dt FAIL 1
.Os
.Sh NAME
.Nm fail
.Nd crash in various possible ways
.Sh SYNOPSIS
.Nm
.Op Fl 123DOacdikrst
.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 a
Call
.Fn abort .
.It Fl c
Violate a
.Fn seccomp
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.
.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/