diff --git a/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/iconv_test.c b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/iconv_test.c new file mode 100644 index 0000000..20d5418 --- /dev/null +++ b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/iconv_test.c @@ -0,0 +1,8 @@ +#include + +int main(void) +{ + iconv_t fd = iconv_open("UTF-8", "EUC-JP"); + iconv_close(fd); + return 0; +} diff --git a/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/main.fmf b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/main.fmf new file mode 100644 index 0000000..8a4b0cb --- /dev/null +++ b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/main.fmf @@ -0,0 +1,24 @@ +summary: Test strncmp intercept for ld.so +contact: Jesus Checa Hidalgo +component: + - valgrind +test: ./runtest.sh +framework: beakerlib +require: + - gcc +link: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2086540 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2081583 +duration: 5m +tier: 1 +tag: + - CI-Tier-1 +adjust: + - enabled: false + when: distro < rhel-9 + continue: false + - test: scl enable $COLLECTIONS -- ./runtest.sh + when: collection is defined + - require+: + - valgrind + when: collection is not defined diff --git a/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/runtest.sh b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/runtest.sh new file mode 100755 index 0000000..9d5dedb --- /dev/null +++ b/Regression/bz2081583-missing-strncmp-intercept-for-ld-so/runtest.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" + rlRun "cp iconv_test.c $tmp/" + rlRun "pushd $tmp" + rlRun "set -o pipefail" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o iconv_test iconv_test.c" + rlRun "valgrind --log-file=valgrind.out ./iconv_test" + rlAssertNotGrep "Invalid read of size" valgrind.out + rlAssertNotGrep "strncmp" valgrind.out + # Ensure valgrind finished clean + if ! rlAssertGrep "ERROR SUMMARY: 0 errors from 0 contexts" valgrind.out; + then + rlLog "`cat valgrind.out`" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" 0 "Remove tmp directory" + rlPhaseEnd +rlJournalEnd