Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360319 - std::function does not work if compiled on armv7hl
Summary: std::function does not work if compiled on armv7hl
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 24
Hardware: armv7hl
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1358845
TreeView+ depends on / blocked
 
Reported: 2016-07-26 12:26 UTC by Kamil Dudka
Modified: 2017-07-26 10:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-26 09:50:04 UTC


Attachments (Terms of Use)
minimal example (deleted)
2016-07-26 12:26 UTC, Kamil Dudka
no flags Details

Description Kamil Dudka 2016-07-26 12:26:44 UTC
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.

Comment 1 Kamil Dudka 2016-07-26 12:28:47 UTC
$ 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

Comment 2 Kamil Dudka 2016-09-12 07:46:22 UTC
Any progress on this?

Comment 3 Fedora End Of Life 2017-07-25 22:04:36 UTC
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.

Comment 4 Jonathan Wakely 2017-07-25 22:34:08 UTC
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.

Comment 5 Kamil Dudka 2017-07-26 09:50:04 UTC
Looks good.  I am able to reproduce it with gcc-7.1.1-3.fc26.armv7hl.

Thank you for fixing it!

Comment 6 Kamil Dudka 2017-07-26 10:49:52 UTC
(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.


Note You need to log in before you can comment on or make changes to this bug.