patchThe GNU Readline library - Patches: patch #9677, Fix...


You are not allowed to post comments on this tracker with your current authentication level.

patch #9677: Fix bash_cv_must_reinstall_sighandlers check in aclocal.m4

Submitter:  Shane Peelar <inbetweennames>
Submitted:  Thu 16 Aug 2018 09:54:19 PM UTC
Votes: 50
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Open

Fri 17 Aug 2018 03:26:59 PM UTC, comment #1: 

Also, I linked to the wrong issue. The correct issue in GentooLTO is here with the aforementioned details:

Shane Peelar <inbetweennames>
Thu 16 Aug 2018 09:54:19 PM UTC, original submission:  

The check bash_cv_must_reinstall_sighandlers in aclocal.m4 uses a non-volatile int, which means the compiler is allowed to optimize away reads and writes to the variable. That is, the compiler can assume the variable will not change due to interference from other processes and threads...and signal handlers.

If this macro is compiled with `-O3` in gcc, for example, the return statement of the check will be essentially optimized to `return 0`. This is not good!

This patch introduces the volatile type qualifier to correctly inform the compiler that all reads and writes should be fully sequenced.

The problem was found courtesy of the user thineye on GitHub as part of the GentooLTO project:

Shane Peelar <inbetweennames>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #44799:  0001-Fix-bash_cv_must_reinstall_sighandlers-check-sigatomic.patch added by inbetweennames (595B - text/x-patch - I just realized, according to the C and C++ standards, the previous patch was still invoking undefined behaviour. Fix this by making the variable of type volatile sig_atomic_t, which is correctly defined in section subsection 5 in the C standard.)
file #44798:  0001-Fix-bash_cv_must_reinstall_sighandlers-check.patch added by inbetweennames (586B - text/x-patch - Updated patch formatted with git format-patch)
file #44795:  volatile.patch added by inbetweennames (284B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Updated the item)
  • -email is unavailable- added by inbetweennames (Voted in favor of this item)
  • -email is unavailable- added by inbetweennames (Submitted the item)

    There are 50 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-13 chet StatusNone Done
    2018-09-30 inbetweennames Carbon-Copy- Added inbetweennames
    2018-08-16 inbetweennames Attached File- Added 0001-Fix-bash_cv_must_reinstall_sighandlers-check-sigatomic.patch, #44799
    2018-08-16 inbetweennames Attached File- Added 0001-Fix-bash_cv_must_reinstall_sighandlers-check.patch, #44798
    2018-08-16 inbetweennames Attached File- Added volatile.patch, #44795

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code