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

history: Work around glibc's fsetpos bug #117

Merged
merged 1 commit into from
Feb 11, 2025
Merged

history: Work around glibc's fsetpos bug #117

merged 1 commit into from
Feb 11, 2025

Conversation

magicant
Copy link
Owner

The fsetpos function in glibc seems to be buggy. It sometimes sets the FILE's error indicator without actually setting errno. This causes the shell to fail to update the history file. To work around this issue, the shell now checks the error indicator after calling fsetpos and re-reads the history file from the beginning if it is set.

The check script for working I/O functions in configure is updated in an attempt to reproduce the issue, but currently it does not catch the bug (at least on my environment with glibc 2.40 on Fedora 41).

@magicant magicant added the bug Something isn't working label Feb 11, 2025
@magicant magicant added this to the 2.59 milestone Feb 11, 2025
@magicant magicant self-assigned this Feb 11, 2025
The fsetpos function in glibc seems to be buggy. It sometimes sets the
FILE's error indicator without actually setting errno. This causes the
shell to fail to update the history file. To work around this issue, the
shell now checks the error indicator after calling fsetpos and re-reads
the history file from the beginning if it is set.

The check script for working I/O functions in configure is updated in an
attempt to reproduce the issue, but currently it does not catch the bug
(at least on my environment with glibc 2.40 on Fedora 41).
@magicant magicant changed the title history: Word around glibc's fsetpos bug history: Work around glibc's fsetpos bug Feb 11, 2025
@magicant magicant merged commit 355fc65 into trunk Feb 11, 2025
3 checks passed
@magicant magicant deleted the fsetpos branch February 11, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant