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 1356531

Summary: libstdc++-6.dll linked by binutils subtly broken
Product: [Fedora] Fedora Reporter: Thomas Sailer <t.sailer>
Component: mingw-binutilsAssignee: Erik van Pienbroek <erik-fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: erik-fedora, fedora-mingw, klember, ktietz, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: mingw-binutils-2.27-1.fc25 mingw-binutils-2.27-1.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-27 10:26:32 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:
Attachments:
Description Flags
objdump -x output difference none

Description Thomas Sailer 2016-07-14 10:28:02 UTC
Description of problem:
When I try to rebuild mingw-gcc-6.1.0-1.fc24.src.rpm with
mingw32-binutils-2.26-1.fc24.x86_64 installed, the C++ runtime library built (libstdc++-6.dll) does not properly work. If I run a program using the libglibmm-2.4-1.dll, it crashes when run with libstdc++-6.dll built with binutils 2.26.

C:\Program Files (x86)\XX\bin>gdb.exe yy.exe
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hex2vec.exe...Reading symbols from C:\Program Files (x86)\XX\bin\yy.exe.debug...
warning: section .gnu_debuglink not found in C:\Program Files (x86)\XX\bin\yy.exe.debug
done.
done.
(gdb) run
Starting program: C:\Program Files (x86)\XX\bin\yy.exe
[New Thread 3268.0x19d0]
warning: section .gnu_debuglink not found in C:\Program Files (x86)\XX\bin\libglibmm-2.4-1.dll.debug

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x666f1cad in __static_initialization_and_destruction_0 (
    __priority=65535, __initialize_p=1)
    at /usr/i686-w64-mingw32/sys-root/mingw/include/c++/iostream:74
#2  _GLOBAL__sub_I__ZN4Glib29get_unichar_from_std_iteratorEN9__gnu_cxx17__normal
_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE ()
    at ../../../glib/glibmm/ustring.cc:1507
#3  0x666ee1dc in __do_global_ctors ()
   from C:\Program Files (x86)\XX\bin\libglibmm-2.4-1.dll
#4  0x00000002 in ?? ()
#5  0x0028fd24 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

If I install binutils 2.25 as was used when building mingw-gcc in the f24 distribution (mingw32-binutils-2.25-3.fc24.x86_64), the libstdc++-6.dll built that way works.

There are rather strange differences in the two libstdc++-6.dlls, the one compiled with 2.26 has less than half the amount of initialized and uninitialized data. I'm attaching the diff -u of the output of objdump -x of the two DLLs.

Version-Release number of selected component (if applicable):
mingw32-binutils-2.26-1.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
1.rpmbuild --rebuild mingw-gcc-6.1.0-1.fc24.src.rpm
2.install newly built RPMs
3.run a program that uses  libglibmm-2.4-1.dll

Actual results:
Wine: runtime linker failure binding __ZNSt8ios_baseC1Ev std::ios_base::ios_base()
Windows: segmentation fault trying to call std::ios_base::ios_base()

Expected results:
Program works

Comment 1 Thomas Sailer 2016-07-14 10:30:15 UTC
Created attachment 1179726 [details]
objdump -x output difference

Comment 2 Kalev Lember 2016-08-17 07:10:33 UTC
Do you have a quick way to check if http://koji.fedoraproject.org/koji/buildinfo?buildID=790558 fixes this?

Comment 3 Thomas Sailer 2016-08-17 10:17:38 UTC
Hi Kalev, no I don't have a quick way, only a rebuild of gcc. But I did anyway, and yes, it fixes this!

So can you please backport binutils 2.26 to f24 and f25?

Thanks!

Comment 4 Kalev Lember 2016-08-17 10:19:04 UTC
Awesome, will do, thanks for checking!

Comment 5 Fedora Update System 2016-08-17 11:26:34 UTC
mingw-binutils-2.27-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-aad09d7d4f

Comment 6 Fedora Update System 2016-08-17 11:26:41 UTC
mingw-binutils-2.27-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3a65fdb7f3

Comment 7 Fedora Update System 2016-08-17 19:53:30 UTC
mingw-binutils-2.27-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3a65fdb7f3

Comment 8 Fedora Update System 2016-08-18 01:51:55 UTC
mingw-binutils-2.27-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-aad09d7d4f

Comment 9 Fedora Update System 2016-08-27 10:26:29 UTC
mingw-binutils-2.27-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2016-08-27 15:18:53 UTC
mingw-binutils-2.27-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.