summaryrefslogtreecommitdiffstats
path: root/tools/debug-alloc.env
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /tools/debug-alloc.env
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/debug-alloc.env')
-rw-r--r--tools/debug-alloc.env33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/debug-alloc.env b/tools/debug-alloc.env
new file mode 100644
index 0000000..d6d454c
--- /dev/null
+++ b/tools/debug-alloc.env
@@ -0,0 +1,33 @@
+##############################################################################
+### Set up environment variables for testing ###
+##############################################################################
+
+# Use the Wmem strict allocator which does canaries and scrubbing etc.
+export WIRESHARK_DEBUG_WMEM_OVERRIDE=strict
+# Abort if a dissector adds too many items to the tree
+export WIRESHARK_ABORT_ON_TOO_MANY_ITEMS=
+
+# Turn on GLib memory debugging (since 2.13)
+export G_SLICE=debug-blocks
+
+# Cause glibc (Linux) to abort() if some memory errors are found
+export MALLOC_CHECK_=3
+
+# Cause FreeBSD (and other BSDs) to abort() on allocator warnings and
+# initialize allocated memory (to 0xa5) and freed memory (to 0x5a). see:
+# https://www.freebsd.org/cgi/man.cgi?query=malloc&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&format=html
+export MALLOC_OPTIONS=AJ
+
+# macOS options; see https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html
+# Initialize allocated memory to 0xAA and freed memory to 0x55
+export MallocPreScribble=1
+export MallocScribble=1
+# Add guard pages before and after large allocations
+export MallocGuardEdges=1
+# Call abort() if heap corruption is detected. Heap is checked every 1000
+# allocations (may need to be tuned!)
+export MallocCheckHeapStart=1000
+export MallocCheckHeapEach=1000
+export MallocCheckHeapAbort=1
+# Call abort() if an illegal free() call is made
+export MallocBadFreeAbort=1