Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST 'SanitizerCommon-asan-i386-Linux :: Linux/sem_init_glibc.cpp' FAILED #58079

Closed
mgorny opened this issue Sep 30, 2022 · 9 comments · Fixed by llvm/llvm-project-release-prs#190

Comments

@mgorny
Copy link
Member

mgorny commented Sep 30, 2022

It seems that there is a new regression in ASAN/glibc support:

FAIL: SanitizerCommon-asan-i386-Linux :: Linux/sem_init_glibc.cpp (76 of 1657)
******************** TEST 'SanitizerCommon-asan-i386-Linux :: Linux/sem_init_glibc.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';      /home/mgorny/git/llvm-bisect/build/lib/llvm/16/bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=address  -m32 -funwind-tables  -I/home/mgorny/git/llvm-bisect/compiler-rt/test -ldl -O0 -g /home/mgorny/git/llvm-bisect/compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cpp -lutil -o /home/mgorny/git/llvm-bisect/build/test/sanitizer_common/asan-i386-Linux/Linux/Output/sem_init_glibc.cpp.tmp &&  /home/mgorny/git/llvm-bisect/build/test/sanitizer_common/asan-i386-Linux/Linux/Output/sem_init_glibc.cpp.tmp
--
Exit Code: 134

Command Output (stderr):
--
sem_init_glibc.cpp.tmp: /home/mgorny/git/llvm-bisect/compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cpp:56: int main(): Assertion `GET_SEM_VALUE(a) == 42' failed.
/home/mgorny/git/llvm-bisect/build/test/sanitizer_common/asan-i386-Linux/Linux/Output/sem_init_glibc.cpp.script: line 1: 2327802 Aborted                 (core dumped) /home/mgorny/git/llvm-bisect/build/test/sanitizer_common/asan-i386-Linux/Linux/Output/sem_init_glibc.cpp.tmp

--

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

This is with 215c9fa.

$ ld.so --version
ld.so (Gentoo 2.36-r3 p3) stable release version 2.36.
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
@mgorny mgorny added compiler-rt:asan Address sanitizer regression labels Sep 30, 2022
@mgorny
Copy link
Member Author

mgorny commented Oct 1, 2022

FWICS GET_SEM_VALUE(a) returns 84 here, so I guess the "old" symbol disappeared on i386 now. I'll make a patch.

@mgorny
Copy link
Member Author

mgorny commented Oct 1, 2022

Filed https://reviews.llvm.org/D135018 for it. I'd appreciate if someone could double-check this, though.

@mgorny
Copy link
Member Author

mgorny commented Oct 1, 2022

Interesting enough, I don't see any obvious difference wrt sem_init symbol:

2.35:

$ readelf -a lib/libc.so.6  | grep sem_init
  1219: 00093d60    83 FUNC    GLOBAL DEFAULT   13 sem_init@GLIBC_2.1
  1224: 00182af0    51 FUNC    GLOBAL DEFAULT   13 sem_init@GLIBC_2.0
  1225: 00093d60    83 FUNC    GLOBAL DEFAULT   13 sem_init@@GLIBC_2.34

2.36:

$ readelf -a /lib/libc.so.6  | grep sem_init
  1227: 0008f800    83 FUNC    GLOBAL DEFAULT   12 sem_init@GLIBC_2.1
  1232: 00176640    51 FUNC    GLOBAL DEFAULT   12 sem_init@GLIBC_2.0
  1233: 0008f800    83 FUNC    GLOBAL DEFAULT   12 sem_init@@GLIBC_2.34

@MaskRay
Copy link
Member

MaskRay commented Oct 2, 2022

The test fails with all 32-bit ports defining sem_init@GLIBC_2.0, i.e. i386, mips32, powerpc32 (they were introduced before glibc 2.1) when running on glibc>=2.36 (I changed dlopen RTLD_NEXT to correctly return the latest version symbol).

https://reviews.llvm.org/D135023 [test] Make Linux/sem_init_glibc.cpp robust should fix it

@MaskRay MaskRay self-assigned this Oct 2, 2022
@MaskRay MaskRay closed this as completed in 6f46ff3 Oct 2, 2022
@mgorny mgorny added this to the LLVM 15.0.2 Release milestone Oct 2, 2022
@mgorny
Copy link
Member Author

mgorny commented Oct 2, 2022

Can we also get it in for 15.0.2, please?

@tru
Copy link
Collaborator

tru commented Oct 13, 2022

Should we PR this to 15.x? @MaskRay?

@mgorny
Copy link
Member Author

mgorny commented Oct 13, 2022

/cherry-pick 6f46ff3

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 13, 2022

/branch llvm/llvm-project-release-prs/issue58079

llvmbot pushed a commit to llvm/llvm-project-release-prs that referenced this issue Oct 13, 2022
and fix it for 32-bit ports defining sem_init@GLIBC_2.0 (i386, mips32, powerpc32) for glibc>=2.36.

Fix llvm/llvm-project#58079

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D135023

(cherry picked from commit 6f46ff3)
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 13, 2022

/pull-request llvm/llvm-project-release-prs#190

@tru tru modified the milestones: LLVM 15.0.3, LLVM 15.0.4 Release Oct 18, 2022
tru pushed a commit to llvm/llvm-project-release-prs that referenced this issue Oct 24, 2022
and fix it for 32-bit ports defining sem_init@GLIBC_2.0 (i386, mips32, powerpc32) for glibc>=2.36.

Fix llvm/llvm-project#58079

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D135023

(cherry picked from commit 6f46ff3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants