https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85449
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> --- So it's very hard to isolate a simple test-case without not doing an UBSAN. Thus easiest way to reproduce that is: $ cd src $ gcc *.c -I. -O3 && ./a.out Fatal error: glibc detected an invalid stdio handle Aborted (core dumped) with the main.c file I sent.