forked from nanocurrency/nano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
124421b
commit 3107540
Showing
4 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
set -uo pipefail | ||
|
||
source "$(dirname "$BASH_SOURCE")/common.sh" | ||
|
||
enable_core_dumps | ||
|
||
BUILD_DIR=${1-${PWD}} | ||
|
||
${BUILD_DIR}/core_test$(get_exec_extension) | ||
executable=${BUILD_DIR}/core_test$(get_exec_extension) | ||
"${executable}" | ||
status=$? | ||
|
||
if [ $status -ne 0 ]; then | ||
echo "Test failed" | ||
exit $status | ||
else | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Print location of core dump loaded from the system config | ||
echo "Core dump location: $(cat /proc/sys/kernel/core_pattern)" | ||
|
||
# List core dump files | ||
echo "Core dump files:" | ||
ls -al "${CORE_DIR}" | ||
|
||
# Find the most recent core dump | ||
core_dump=$(find "${CORE_DIR}" -name 'coredump-*' -printf "%T+ %p\n" | sort -r | head -n 1 | cut -d" " -f2-) | ||
|
||
if [ -n "$core_dump" ]; then | ||
echo "Analyzing core dump: $core_dump" | ||
|
||
# Use gdb to print the backtrace from the core dump | ||
gdb -quiet -batch -ex "thread apply all bt full" -ex "quit" "${executable}" "${core_dump}" | ||
else | ||
echo "No core dump file found." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters