Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2082525

Summary: [aarch64] llvm-integration-testsuite failures
Product: Red Hat Enterprise Linux 8 Reporter: Jesus Checa <jchecahi>
Component: llvmAssignee: Timm Bäder <tbaeder>
Status: CLOSED ERRATA QA Contact: Jesus Checa <jchecahi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.7CC: dbenoit, jchecahi, mprchlik, sipoyare, tbaeder
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: llvm-toolset-rhel8-8070020220527081631.3b9f49c4 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:34:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2022-06-20   

Description Jesus Checa 2022-05-06 10:34:35 UTC
Description of problem:
test_leaksan.c (https://github.com/opencollab/llvm-toolchain-integration-test-suite/blob/main/tests/test_leaksan.c) fails in aarch64 with rhel-8 llvm module.
When running the testsuite the output of the test is the following:
---
******************** TEST 'LLVM regression suite :: test_leaksan.c' FAILED ********************
Script:
--
: 'RUN: at line 4';   /usr/bin/clang -o /root/llvm-toolchain-integration-test-suite/bld/tests/Output/test_leaksan.c.tmp -fsanitize=address -g /root/llvm-toolchain-integration-test-suite/tests/test_leaksan.c
: 'RUN: at line 5';   env ASAN_OPTIONS="log_path=stdout:exitcode=0"  /root/llvm-toolchain-integration-test-suite/bld/tests/Output/test_leaksan.c.tmp 2>&1 > /root/llvm-toolchain-integration-test-suite/bld/tests/Output/test_leaksan.c.tmp.out
: 'RUN: at line 6';   grep -q "detected memory leaks" /root/llvm-toolchain-integration-test-suite/bld/tests/Output/test_leaksan.c.tmp.out
--
Exit Code: 1
---

Inspecting the output file (test_leaksan.c.tmp.out) shows an empty file. 

Version-Release number of selected component (if applicable):
llvm-toolset-rhel8-8070020220429060729.3b9f49c4

How reproducible:
100%

Steps to Reproduce:
1. git clone https://github.com/opencollab/llvm-toolchain-integration-test-suite
2. cd llvm-toolchain-integration-test-suite
3. mkdir bld && cd bld
4. cmake .. -DENABLE_LIBCXX=OFF
5. lit --show-unsupported --show-xfail -v tests

Actual results:
test_leaksan.c.tmp shows no LeakSanitizer output.

Expected results:
Taking x86_64 run, the expected output should be similar to this:

=================================================================
==40965==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 7 byte(s) in 1 object(s) allocated from:
    #0 0x4c1e68 in __interceptor_malloc.part.10 asan_malloc_linux.cpp.o
    #1 0x510518 in main /root/llvm-toolchain-integration-test-suite/tests/test_leaksan.c:13:7
    #2 0x7fc49a197ca2 in __libc_start_main (/lib64/libc.so.6+0x3aca2) (BuildId: cb39b1f4faf888b6cf109897e14befa24b9d7f86)

SUMMARY: AddressSanitizer: 7 byte(s) leaked in 1 allocation(s).


Additional info:

Comment 1 Jesus Checa 2022-05-25 11:56:08 UTC
From new module build llvm-toolset:rhel8:8070020220524144606:3b9f49c4 the test "lto_and_cross_dso_cfi.c" is also failing.

FAIL: LLVM regression suite :: lto_and_cross_dso_cfi.c (22 of 44)
******************** TEST 'LLVM regression suite :: lto_and_cross_dso_cfi.c' FAILED ********************
Script:
--
: 'RUN: at line 2';   mkdir /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp.dir
: 'RUN: at line 3';   /usr/bin/clang -UMAIN -flto -fsanitize=cfi -fsanitize-cfi-cross-dso -fvisibility=default -fuse-ld=lld /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/tests/lto_and_cross_dso_cfi.c -shared -o /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp.dir/liblocalcrossdso.so
: 'RUN: at line 4';   /usr/bin/clang -DMAIN -flto -fsanitize=cfi -fsanitize-cfi-cross-dso -fvisibility=default -fuse-ld=lld /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/tests/lto_and_cross_dso_cfi.c -o /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp -L/var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp.dir -llocalcrossdso
: 'RUN: at line 5';   LD_LIBRARY_PATH=/var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp.dir /var/tmp/tmp.oaNPCNytor/llvm-toolchain-integration-test-suite/_build/tests/Output/lto_and_cross_dso_cfi.c.tmp
: 'RUN: at line 6';   rm -f liblocalcrossdso.so
--
Exit Code: 1

Command Output (stderr):
--
CFI: CHECK failed: cfi.cpp:195 "((4096)) == ((GetPageSizeCached()))" (0x1000, 0x10000) (tid=34024)

--

********************

test_leaksan.c keeps failing.

Comment 2 serge_sans_paille 2022-05-25 13:18:58 UTC
I wouldn't be surprised to learn that aarch64 defaults to 64k page on rhel8.7. If that's indeed the case, the RHEL-specific patch would be to change the default page size in `cfi.cpp` from

```
#define kCfiShadowLimitsStorageSize 4096 // 1 page
```

to

```
#define kCfiShadowLimitsStorageSize 65536 // 1 page
```

Comment 3 Jesus Checa 2022-06-03 15:03:01 UTC
Module llvm-toolset-rhel8-8070020220527081631.3b9f49c4 fixes the failure in lto_and_cross_dso_cfi.c

We'll move this bug to VERIFIED and defer the test_leaksan failure to bug 2093385

Comment 9 errata-xmlrpc 2022-11-08 09:34:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (llvm-toolset:rhel8 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7537