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

buffer flush issue on glibc FILE #4229

Closed
emmanuelthome opened this issue Nov 7, 2024 · 1 comment
Closed

buffer flush issue on glibc FILE #4229

emmanuelthome opened this issue Nov 7, 2024 · 1 comment

Comments

@emmanuelthome
Copy link

Hi

The following code produces wrong output on the current master (720da57): https://godbolt.org/z/x53n1KhcM. I tried g++-14, clang-16, clang-20. Linux current debian testing, glibc 2.40-3 (this happens on the current debian:testing docker image)

When the underlying FILE gets flushed, there's data from the existing buffer that gets printed again. E.g. the output is:

$ clang++ -I include  mytest.cpp src/format.cc src/os.cc && ./a.out
5393 defgh493

The problem disappears if I set FMT_USE_FALLBACK_FILE to 1.

@vitaut
Copy link
Contributor

vitaut commented Nov 9, 2024

Fixed in a35389b, thanks for reporting.

@vitaut vitaut closed this as completed Nov 9, 2024
emmanuelthome added a commit to cado-nfs/cado-nfs that referenced this issue Jan 6, 2025
Clearly fmt 11.0.2 does not compile with clang-20. Yet the current fmt
tip-of-tree triggers a bug with the full_F7 test, where apparently the
fflush(_unlocked) seems to leave garbage in the write buffer. See
fmtlib/fmt#4229 for a reproducer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants