Skip to content

history: Work around glibc's fsetpos bug#117

Merged
magicant merged 1 commit into
trunkfrom
fsetpos
Feb 11, 2025
Merged

history: Work around glibc's fsetpos bug#117
magicant merged 1 commit into
trunkfrom
fsetpos

Conversation

@magicant

Copy link
Copy Markdown
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
@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