Created attachment 1184246 [details] minimal example Version-Release number of selected component (if applicable): gcc-6.1.1-3.fc24.armv7hl How reproducible: Deterministically. Steps to Reproduce: 1. Run the attached minimal example. Actual results: Use of uninitialised value, then SIGSEGV. Additional info: - The same code compiled on x86_64 runs fine with silent valgrind. - The same code compiled on armv7hl with -fno-strict-aliasing works fine with silent valgrind. - This bug causes nghttpx to crash on armv7hl (bug #1358845). Attachment #1184185 [details] can be used as a workaround for this bug.
$ curl -JO 'https://bugzilla.redhat.com/attachment.cgi?id=1184246' $ sh std-function-armv7hl.cc + g++ -std=c++11 -g -O2 -Wall -Wextra std-function-armv7hl.cc + valgrind ./a.out ==21418== Memcheck, a memory error detector ==21418== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==21418== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==21418== Command: ./a.out ==21418== ==21418== Conditional jump or move depends on uninitialised value(s) ==21418== at 0x1095C: __invoke_impl<int, int (C::* const&)(), C&> (functional:226) ==21418== by 0x1095C: __invoke<int (C::* const&)(), C&> (functional:260) ==21418== by 0x1095C: operator()<C&> (functional:613) ==21418== by 0x1095C: std::_Function_handler<int (C&), int (C::*)()>::_M_invoke(std::_Any_data const&, C&) (functional:1788) ==21418== by 0x1078B: operator() (functional:2136) ==21418== by 0x1078B: run (std-function-armv7hl.cc:25) ==21418== by 0x1078B: main (std-function-armv7hl.cc:36) ==21418== ==21418== Use of uninitialised value of size 4 ==21418== at 0x10960: __invoke_impl<int, int (C::* const&)(), C&> (functional:226) ==21418== by 0x10960: __invoke<int (C::* const&)(), C&> (functional:260) ==21418== by 0x10960: operator()<C&> (functional:613) ==21418== by 0x10960: std::_Function_handler<int (C&), int (C::*)()>::_M_invoke(std::_Any_data const&, C&) (functional:1788) ==21418== by 0x1078B: operator() (functional:2136) ==21418== by 0x1078B: run (std-function-armv7hl.cc:25) ==21418== by 0x1078B: main (std-function-armv7hl.cc:36) ==21418== ==21418== Jump to the invalid address stated on the next line ==21418== at 0x2: ??? ==21418== Address 0x2 is not stack'd, malloc'd or (recently) free'd ==21418== ==21418== ==21418== Process terminating with default action of signal 11 (SIGSEGV) ==21418== Bad permissions for mapped region at address 0x2 ==21418== at 0x2: ??? ==21418== ==21418== HEAP SUMMARY: ==21418== in use at exit: 0 bytes in 0 blocks ==21418== total heap usage: 2 allocs, 2 frees, 24,320 bytes allocated ==21418== ==21418== All heap blocks were freed -- no leaks are possible ==21418== ==21418== For counts of detected and suppressed errors, rerun with: -v ==21418== Use --track-origins=yes to see where uninitialised values come from ==21418== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) std-function-armv7hl.cc: line 4: 21418 Segmentation fault (core dumped) valgrind ./a.out <<< 42 + exit 139
Any progress on this?
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This is probably https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686 which was fixed upstream in GCC 6.3 and so should be fixed by one of the gcc errata for f24.
Looks good. I am able to reproduce it with gcc-7.1.1-3.fc26.armv7hl. Thank you for fixing it!
(In reply to Kamil Dudka from comment #5) > I am able to reproduce it with gcc-7.1.1-3.fc26.armv7hl. Sorry, I meant to say that I am _not_ able to reproduce it with gcc-7.1.1-3.fc26.armv7hl.