From fb05a8d516a0721b3f78b3ff3fa549c37d7654ed Mon Sep 17 00:00:00 2001
From: Olivier Dion <olivier.dion@savoirfairelinux.com>
Date: Thu, 10 Jun 2021 15:41:17 -0400
Subject: [PATCH] fuzzing: Add GDB script

Change-Id: Ia9ce297062ac28dcf7f03ee28247cad4411d1b0f
---
 test/fuzzing/.gdbinit | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 test/fuzzing/.gdbinit

diff --git a/test/fuzzing/.gdbinit b/test/fuzzing/.gdbinit
new file mode 100644
index 0000000000..aded69e115
--- /dev/null
+++ b/test/fuzzing/.gdbinit
@@ -0,0 +1,18 @@
+# Run in RAM - Don't fill my disk!
+set environment XDG_DATA_HOME=/tmp/jami
+set environment XDG_CONFIG_HOME=/tmp/jami
+set environment XDG_CACHE_HOME=/tmp/jami
+
+# Get full backtrace on any error detected
+set environment UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
+set environment ASAN_OPTIONS=print_stacktrace=1:halt_on_error=1
+
+# All TLS conversation to out and stop if log level over critical
+set environment SUPERVISOR_TLS_OUT=out
+set environment SUPERVISOR_LOG=CRIT
+
+# Break on any error repport by ASAN or if sanitizer die
+break __asan::ReportGenericError
+break __sanitizer::Die
+
+run
-- 
GitLab