File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,44 @@ Some issues with flags can be debugged using the ``verbosity=$NUM`` flag:
203
203
misspelled_flag
204
204
...
205
205
206
+ Additional customization
207
+ ------------------------
208
+
209
+ In addition to ``__rtsan_default_options `` outlined above, you can provide definitions of other functions that affect how RTSan operates.
210
+
211
+ To be notified on every error reported by RTsan, provide a definition of ``__sanitizer_report_error_summary ``.
212
+
213
+ .. code-block :: c
214
+
215
+ extern "C" void __sanitizer_report_error_summary(const char *error_summary) {
216
+ fprintf(stderr, "%s %s\n", "In custom handler! ", error_summary);
217
+ /* do other custom things */
218
+ }
219
+
220
+ The error summary will be of the form:
221
+
222
+ .. code-block :: console
223
+
224
+ SUMMARY: RealtimeSanitizer: unsafe-library-call main.cpp:8 in process(std::__1::vector<int, std::__1::allocator<int>>&)
225
+
226
+ To register a callback which will be invoked before a RTSan kills the process:
227
+
228
+ .. code-block :: c
229
+
230
+ extern "C" void __sanitizer_set_death_callback(void (*callback)(void));
231
+
232
+ void custom_on_die_callback() {
233
+ fprintf(stderr, "In custom handler!")
234
+ /* do other custom things */
235
+ }
236
+
237
+ int main()
238
+ {
239
+ __sanitizer_set_death_callback(custom_on_die_callback);
240
+ ...
241
+ }
242
+
243
+
206
244
Disabling and suppressing
207
245
-------------------------
208
246
You can’t perform that action at this time.
0 commit comments