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

[libc] printf test no longer work after recent changes #98711

Closed
SchrodingerZhu opened this issue Jul 13, 2024 · 0 comments
Closed

[libc] printf test no longer work after recent changes #98711

SchrodingerZhu opened this issue Jul 13, 2024 · 0 comments
Labels
cmake Build system in general and CMake in particular libc regression test-suite

Comments

@SchrodingerZhu
Copy link
Contributor

After recent changes, printf family test no long work in full build mode.
In debug build, the program hang forever at the following scene:

❯ gdb /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio/libc.test.src.stdio.fprintf_test.__unit__.__build
__
GNU gdb (GDB; openSUSE Tumbleweed) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio/libc.test.src.stdio.fprintf_test.__unit__.__build__...
(gdb) r
Starting program: /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio/libc.test.src.stdio.fprintf_test.__unit__.__build__ 
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.39-9.1.aarch64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFPrintfTest.WriteToFile
[       OK ] LlvmLibcFPrintfTest.WriteToFile (177 us)
Ran 1 tests.  PASS: 1  FAIL: 0
^C
Program received signal SIGINT, Interrupt.
0x0000fffff7ac7f58 in __lll_lock_wait_private () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install libgcc_s1-debuginfo-14.1.1+git10335-1.1.aarch64 libstdc++6-debuginfo-14.1.1+git10335-1.1.aarch64
(gdb) bt
#0  0x0000fffff7ac7f58 in __lll_lock_wait_private () from /lib64/libc.so.6
#1  0x0000fffff7ab4e04 in fflush () from /lib64/libc.so.6
#2  0x0000fffff7d4745c in std::basic_ostream<char, std::char_traits<char> >::flush() () from /lib64/libstdc++.so.6
#3  0x0000fffff7cc4004 in std::ios_base::Init::~Init() () from /lib64/libstdc++.so.6
#4  0x0000fffff7a83e58 in __cxa_finalize () from /lib64/libc.so.6
#5  0x0000fffff7cad9a0 in ?? () from /lib64/libstdc++.so.6
Backtrace 

In release build, I sometime get

[3128/4107] Running unit test libc.test.src.stdio.fprintf_test.__unit__
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fprintf_test.__unit__ /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fprintf_test.__unit__ 
cd /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio && /home/schrodinger/development/llvm-project/build-2/libc/test/src/stdio/libc.test.src.stdio.fprintf_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFPrintfTest.WriteToFile
[       OK ] LlvmLibcFPrintfTest.WriteToFile (76 us)
Ran 1 tests.  PASS: 1  FAIL: 0
Fatal error: glibc detected an invalid stdio handle
@github-actions github-actions bot added the libc label Jul 13, 2024
@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular test-suite labels Jul 13, 2024
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this issue Jul 14, 2024
Summary:
This causes errors when running unit tests when it tries to use an
invalid stdio handle.

Fixes llvm#98711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular libc regression test-suite
Projects
None yet
Development

No branches or pull requests

2 participants