Skip to content

Commit

Permalink
Introduce deliberate segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Sep 10, 2024
1 parent 7c68242 commit 44b7271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/build-support/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,15 @@ function print_coredumps() {
if [ -n "$COREFILES" ]; then
for COREFILE in $COREFILES; do
COREPATH="/tmp/${COREFILE}"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Running '${TEST_EXECUTABLE}' produced core dump at '${COREPATH}', printing backtrace:"
# Print backtrace
if [ "$(uname)" == "Darwin" ]; then
lldb -c "${COREPATH}" --batch --one-line "thread backtrace all -e true"
else
gdb -c "${COREPATH}" $TEST_EXECUTABLE -ex "thread apply all bt" -ex "set pagination 0" -batch
fi
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# Remove the coredump, it can be regenerated via running the test case directly
rm "${COREPATH}"
done
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/memory_pool_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ TEST(LoggingMemoryPool, Logging) {

uint8_t* data2;
ASSERT_OK(lp.Allocate(100, &data2));
ASSERT_EQ(data2[1 << 30], 42);

lp.Free(data, 100);
lp.Free(data2, 100);
Expand Down

0 comments on commit 44b7271

Please sign in to comment.