Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1589111

Summary: devtools-6 and devtoolset-7 with libstdc++-4.8 operates incorrectly with std::error_condition
Product: Red Hat Developer Toolset Reporter: Dmitry Mikhirev <mikhirev>
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 8.0 RHEL 7CC: jakub, kanderso, law, mcermak, mnewsome, ohudlick, sipoyare
Target Milestone: ---   
Target Release: 8.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-09 21:55:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer code none

Description Dmitry Mikhirev 2018-06-08 12:29:09 UTC
Created attachment 1449110 [details]
reproducer code

Description of problem:

Trying to build cpprestsdk with devtools-6 on CentOS 7 I've found a problem. Access to std::error_condition obtained from caught std::system_error exception returns garbage. The reproducer code is attached.

It seems that the root of the problem is the old libstdc++ shared library, because adding -static-libstdc++ fixes the issue.


Version-Release number of selected component (if applicable):

gcc version 6.3.1 20170216 (Red Hat 6.3.1-3) (GCC)


How reproducible:

Always.


Steps to Reproduce:
1. Download attached test.cc.
2. scl enable devtoolset-6 -- c++ -o test test.cc
3. ./test


Actual results:

    Expected error condition code: 2
    Error error condition message: No such file or directory
    failed to open file
    errno = 2
    No such file or directory: No such file or directory
    Error code: 2
    Error message: No such file or directory
    Error condition code: 6341176
    Segmentation fault (core dumped)


Expected results:

    Expected error condition code: 2
    Error error condition message: No such file or directory
    failed to open file
    errno = 2
    No such file or directory: No such file or directory
    Error code: 2
    Error message: No such file or directory
    Error condition code: 2
    Error condition message: No such file or directory


Additional info:

The bug is also reproducible with devtoolset-7.

Comment 1 Marek Polacek 2018-07-25 13:27:31 UTC
Likely the same issue as PR69191 reported upstream.

Comment 4 Marek Polacek 2019-07-09 19:27:19 UTC
PR69191 doesn't seem to be resolved either way.  DTS 10.

Comment 5 Marek Polacek 2020-12-09 21:55:05 UTC
This BZ is getting stale and there hasn't been any progress in the upstream PR.  Closing out, let's track this in the upstream bug.