mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-02 03:36:54 +08:00
On Linux, this requires that gdb can be found in PATH, and that no kernel security settings like yama.ptrace_scope prevent it. Patch contains also a drive-by architecture detection fix for Debian arm64. Fixes: QTQAINFRA-6029 Fixes: QTQAINFRA-5940 Fixes: QTQAINFRA-6030 Fixes: QTQAINFRA-6046 Fixes: QTQAINFRA-6012 Fixes: QTQAINFRA-5930 Task-number: QTQAINFRA-5933 Change-Id: Ie6debde94c1cc5783161ffa7354b58734c372702 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Toni Saario <toni.saario@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#Copyright (C) 2023 The Qt Company Ltd
|
|
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
|
|
|
### Enable automatic stacktraces in case of fatal errors in QTest.
|
|
# This requires that gdb can be found in PATH, and that no
|
|
# kernel security settings like yama.ptrace_scope prevent it.
|
|
|
|
|
|
PROVISIONING_DIR="$(dirname "$0")/../.."
|
|
source "$PROVISIONING_DIR/common/unix/common.sourced.sh"
|
|
|
|
|
|
f="/etc/sysctl.d/10-ptrace.conf"
|
|
if [ -f $f ]
|
|
then
|
|
echo "Modifying $f ..."
|
|
sudo sed -i '/^kernel\.yama\.ptrace_scope *= *[1-9]$/s/[1-9]$/0/' $f
|
|
# Reload the modified setting, so that we can verify it right afterwards.
|
|
sudo sysctl -p $f
|
|
fi
|
|
|
|
# Verify that yama.ptrace_scope = 0, if it's supported by the kernel.
|
|
ptrace_scope_value=`sudo sysctl kernel.yama.ptrace_scope 2>/dev/null \
|
|
| sed -E 's/.*([0-9])$/\1/'`
|
|
if [ -n "$ptrace_scope_value" ] && [ "$ptrace_scope_value" != 0 ]
|
|
then
|
|
fatal "kernel.yama.ptrace_scope = $ptrace_scope_value \
|
|
which means that QTest automatic stacktraces will not work"
|
|
else
|
|
echo kernel.yama.ptrace_scope = "$ptrace_scope_value"
|
|
fi
|
|
|
|
|
|
$CMD_PKG_INSTALL gdb
|