forked from bugsnag/bugsnag-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crashprobe.feature
192 lines (174 loc) · 9.8 KB
/
crashprobe.feature
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
Feature: Reporting crash events
Background:
Given I clear all persistent data
Scenario: Executing privileged instruction
When I run "PrivilegedInstructionScenario" and relaunch the app
And I configure Bugsnag for "PrivilegedInstructionScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the error payload field "events" is an array with 1 elements
And the exception "errorClass" equals one of:
| Intel | EXC_BAD_ACCESS |
| ARM | EXC_BAD_INSTRUCTION |
And the "method" of stack frame 0 equals "-[PrivilegedInstructionScenario run]"
Scenario: Calling __builtin_trap()
When I run "BuiltinTrapScenario" and relaunch the app
And I configure Bugsnag for "BuiltinTrapScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the error payload field "events" is an array with 1 elements
And the exception "errorClass" equals one of:
| Intel | EXC_BAD_INSTRUCTION |
| ARM | EXC_BREAKPOINT |
And the "method" of stack frame 0 equals "-[BuiltinTrapScenario run]"
Scenario: Calling non-existent method
When I run "NonExistentMethodScenario" and relaunch the app
And I configure Bugsnag for "NonExistentMethodScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the error payload field "events" is an array with 1 elements
And the exception "message" starts with "-[NonExistentMethodScenario santaclaus:]: unrecognized selector sent to instance"
And the exception "errorClass" equals "NSInvalidArgumentException"
And the event "exceptions.0.stacktrace.0.method" equals one of:
| <redacted> |
| __exceptionPreprocess |
And the event "exceptions.0.stacktrace.1.method" equals one of:
| <redacted> |
| objc_exception_throw |
And the event "exceptions.0.stacktrace.2.method" equals one of:
| <redacted> |
| -[NSObject(NSObject) doesNotRecognizeSelector:] |
And the event "exceptions.0.stacktrace.3.method" equals one of:
| <redacted> |
| ___forwarding___ |
And the "method" of stack frame 4 equals "_CF_forwarding_prep_0"
And the "method" of stack frame 5 equals "-[NonExistentMethodScenario run]"
Scenario: Trigger a crash after overwriting the link register
When I run "OverwriteLinkRegisterScenario" and relaunch the app
And I configure Bugsnag for "OverwriteLinkRegisterScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the exception "message" equals "Attempted to dereference null pointer."
And the "method" of stack frame 0 equals "-[OverwriteLinkRegisterScenario run]"
Scenario: Attempt to write into a read-only page
When I run "ReadOnlyPageScenario" and relaunch the app
And I configure Bugsnag for "ReadOnlyPageScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "-[ReadOnlyPageScenario run]"
Scenario: Stack overflow
When I run "StackOverflowScenario"
# Present to allow the scenario to crash
And I wait for 3 seconds
And I relaunch the app
And I configure Bugsnag for "StackOverflowScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "message" equals "Stack overflow in -[StackOverflowScenario run]"
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 1 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 2 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 3 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 4 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 5 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 6 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 7 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 8 equals "-[StackOverflowScenario run]"
And the "method" of stack frame 9 equals "-[StackOverflowScenario run]"
Scenario: Crash inside objc_msgSend()
When I run "ObjCMsgSendScenario" and relaunch the app
And I configure Bugsnag for "ObjCMsgSendScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the exception "message" equals one of:
| ARM | Attempted to dereference garbage pointer 0x38. |
| Intel | Attempted to dereference garbage pointer 0x40. |
And the "method" of stack frame 0 equals "objc_msgSend"
Scenario: Attempt to execute an instruction undefined on the current architecture
When I run "UndefinedInstructionScenario" and relaunch the app
And I configure Bugsnag for "UndefinedInstructionScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "EXC_BAD_INSTRUCTION"
And the "method" of stack frame 0 equals "-[UndefinedInstructionScenario run]"
Scenario: Send a message to an object whose memory has already been freed
When I run "ReleasedObjectScenario" and relaunch the app
And I configure Bugsnag for "ReleasedObjectScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "message" matches "Attempted to dereference (garbage|null) pointer"
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "objc_msgSend"
And the "method" of stack frame 1 equals one of:
| ARM | __29-[ReleasedObjectScenario run]_block_invoke |
| Intel | -[ReleasedObjectScenario run] |
Scenario: Crash within Swift code
When I run "SwiftCrash" and relaunch the app
And I configure Bugsnag for "SwiftCrash"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "Fatal error"
And the exception "message" equals "Unexpectedly found nil while unwrapping an Optional value"
And the event "metaData.error.crashInfo" matches "Fatal error: Unexpectedly found nil while unwrapping an Optional value"
Scenario: Assertion failure in Swift code
When I run "SwiftAssertion" and relaunch the app
And I configure Bugsnag for "SwiftAssertion"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals "Fatal error"
And the exception "message" equals "several unfortunate things just happened"
And the event "metaData.error.crashInfo" matches "Fatal error: several unfortunate things just happened"
Scenario: Dereference a null pointer
When I run "NullPointerScenario" and relaunch the app
And I configure Bugsnag for "NullPointerScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "message" equals "Attempted to dereference null pointer."
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "-[NullPointerScenario run]"
Scenario: Trigger a crash with libsystem_pthread's _pthread_list_lock held
When I run "AsyncSafeThreadScenario" and relaunch the app
And I configure Bugsnag for "AsyncSafeThreadScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the error payload field "events" is an array with 1 elements
And the exception "message" equals "Attempted to dereference garbage pointer 0x1."
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the stacktrace contains methods:
# |pthread_getname_np|
| -[AsyncSafeThreadScenario run] |
Scenario: Trigger a crash with simulated malloc() lock held
When I run "AsyncSafeMallocScenario" and relaunch the app
And I configure Bugsnag for "AsyncSafeMallocScenario"
And I wait to receive an error
And the exception "errorClass" equals "SIGABRT"
Scenario: Read a garbage pointer
When I run "ReadGarbagePointerScenario" and relaunch the app
And I configure Bugsnag for "ReadGarbagePointerScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "message" starts with "Attempted to dereference garbage pointer"
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "-[ReadGarbagePointerScenario run]"
Scenario: Access a non-object as an object
When I run "AccessNonObjectScenario" and relaunch the app
And I configure Bugsnag for "AccessNonObjectScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "message" equals "Attempted to dereference garbage pointer 0x10."
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "objc_msgSend"
Scenario: Misuse of libdispatch
When I run "DispatchCrashScenario" and relaunch the app
And I configure Bugsnag for "DispatchCrashScenario"
And I wait to receive an error
Then the error is valid for the error reporting API
And the exception "errorClass" equals one of:
| ARM | EXC_BREAKPOINT |
| Intel | EXC_BAD_INSTRUCTION |
And the exception "message" starts with "BUG IN CLIENT OF LIBDISPATCH: dispatch_"
And the event "metaData.error.crashInfo" starts with "BUG IN CLIENT OF LIBDISPATCH: dispatch_"