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 'MemorySanitizer-X86_64 :: fstat.cpp' FAILED #49835

Closed
neilnelson mannequin opened this issue May 26, 2021 · 9 comments
Closed

TEST 'MemorySanitizer-X86_64 :: fstat.cpp' FAILED #49835

neilnelson mannequin opened this issue May 26, 2021 · 9 comments
Labels
bugzilla Issues migrated from bugzilla release:fixed-in-main

Comments

@neilnelson
Copy link
Mannequin

neilnelson mannequin commented May 26, 2021

Bugzilla Link 50491
Version 12.0
OS Linux
Blocks #51489
CC @tstellar

Extended Description

Obtained this error on Ubuntu 21.04 12.0.1 rc1 release run.

FAIL: MemorySanitizer-X86_64 :: fstat.cpp (76302 of 87931)
******************** TEST 'MemorySanitizer-X86_64 :: fstat.cpp' FAILED ********************
Script:

: 'RUN: at line 1'; /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/Phase3/Release+Asserts/llvmCore-12.0.1-rc1.obj/./bin/clang --driver-mode=g++ -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -gline-tables-only -O0 /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/llvm-project/compiler-rt/test/msan/fstat.cpp -o /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/Phase3/Release+Asserts/llvmCore-12.0.1-rc1.obj/projects/compiler-rt/test/msan/X86_64/Output/fstat.cpp.tmp && /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/Phase3/Release+Asserts/llvmCore-12.0.1-rc1.obj/projects/compiler-rt/test/msan/X86_64/Output/fstat.cpp.tmp

Exit Code: 1

Command Output (stderr):

==2490251==WARNING: MemorySanitizer: use-of-uninitialized-value
#​0 0x49b929 in main /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/llvm-project/compiler-rt/test/msan/fstat.cpp:11:7
#​1 0x7f73b634f564 in __libc_start_main csu/../csu/libc-start.c:332:16
#​2 0x41d24d in _start (/home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/Phase3/Release+Asserts/llvmCore-12.0.1-rc1.obj/projects/compiler-rt/test/msan/X86_64/Output/fstat.cpp.tmp+0x41d24d)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/nnelson/Documents/llvm-project/llvm/utils/release/rc1/llvm-project/compiler-rt/test/msan/fstat.cpp:11:7 in main
Exiting

@neilnelson
Copy link
Mannequin Author

neilnelson mannequin commented Aug 18, 2021

Added release-13.0.0 to the Blocks field. This bug was seen on the 13.0.0-rc1 release run.

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@asl asl added this to the LLVM 13.0.1 release milestone Dec 12, 2021
@mgorny
Copy link
Member

mgorny commented Dec 18, 2021

FWICS this can be fixed by backporting:

commit 4e1a6c0

Author: Nikita Malyavin <nikitamalyavin@gmail.com>
Date:   2021-10-21 01:53:50 +0200

    [msan] Add stat-family interceptors on Linux
    
    Add following interceptors on Linux: stat, lstat, fstat, fstatat.
    
    This fixes use-of-uninitialized value on platforms with GLIBC 2.33+.
    In particular: Arch Linux, Ubuntu hirsute/impish.
    
    The tests should have also been failing during the release on the mentioned platforms, but I cannot find any related discussion.
    
    Most likely, the regression was introduced by glibc commit [[ https://github.com/bminor/glibc/commit/8ed005daf0ab03e142500324a34087
ce179ae78e | 8ed005daf0ab03e14250032 ]]:
    all stat-family functions are now exported as shared functions.
    
    Before, some of them (namely stat, lstat, fstat, fstatat) were provided as a part of libc_noshared.a and called their __xstat doppl
egangers. This is still true for Debian Sid and earlier Ubuntu's. stat interceptors may be safely provided for them, no problem with th
at.
    
    Closes https://github.com/google/sanitizers/issues/1452.
    See also https://jira.mariadb.org/browse/MDEV-24841
    
    Reviewed By: eugenis
    
    Differential Revision: https://reviews.llvm.org/D111984

CC @FooBarrior

I have mixed feelings whether we should backport it — on one hand, it seems a bit complex, on the other it isn't that long and applies cleanly.

@mgorny
Copy link
Member

mgorny commented Dec 18, 2021

(sorry, wrong commit id in the original comment, fixed now)

@tstellar
Copy link
Collaborator

/cherry-pick 4e1a6c0

@tstellar
Copy link
Collaborator

Merged: b40f07b

@DimitryAndric
Copy link
Collaborator

/cherry-pick b4fb423

@DimitryAndric DimitryAndric reopened this Jan 13, 2022
@DimitryAndric
Copy link
Collaborator

This needs an additional cherry-pick to make it compile on non-Linux platforms.

@tstellar
Copy link
Collaborator

Merged: b9a243d 5869ea6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla release:fixed-in-main
Projects
None yet
Development

No branches or pull requests

4 participants