Description of problem: We are having some really weird issue linking a project. It all started with someone reporting a crash calling sprintf. The code appeared correct and not causing any possible overflow but compiling from a Fedora 26 system (also reported using Fedora 27) instead of a Fedora 25 (so cross compiling from a x64 Linux system for a 64 bit Windows) start causing the crash. I spent quite some time digging the issue and I realized that the resulting executable has a missing relocation. Basically the sprintf call is compiled as "call next" instruction (e8 00 00 00 00) like the relocation to sprintf (in our environment sprintf is redirected to a function calling __mingw_vsprintf so there should be a relative call). It turned out that removing -flto -fwhole-program from the C++ compiler option make the problem disappear. More digging during the linking ld create a .s file from all LTO modules and pass to as, the .s file (I used -save-temp) have the sprintf call, the resulting object file has the correct relocation but the final .exe do not have this relocation. I tried to use the resulting object and call ld removing plugin options and the resulting executable is fine; not sure however if this demonstrate that the problem is in the lto plugin. The program is an agent for Windows you can find at https://cgit.freedesktop.org/spice/win32/vd_agent/. I tried to remove some code to get a minimal version but the problem disappeared. Not sure what I can post for this report. Version-Release number of selected component (if applicable): mingw64-binutils-2.27 mingw64-gcc-c++-7.0.1 mingw64-headers-5.0.1 How reproducible: Always Steps to Reproduce: 1. download spice guest agent from git (commit 241425b7da80626f0d3bc471202e753f0f1dd178) 2. compile it from Fedora 64 targeting 64 bit system 3. check handle_start for sprintf call Actual results: The code calls sprintf Expected results: Code call next instruction
Sorry, I don't think we have anyone with compiler internals knowledge looking at mingw bugs. Can you file this upstream where it is likely to get more attention, please? I'm happy to backport fixes once it's resolved upstream.
Opened a bug at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81879
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. 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 '26'. 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 26 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.
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
This happens again in Fedora 28
This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. 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 '28'. 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 28 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.
Still present in Fedora 30. This was fixed after upstream binutils 2.32, but Fedora still uses binutils 2.30 for MingW. The upstream patch is https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=2219ae0b0ebe14373850b000c2abaa31dab1d741.
This was duplicated of rhbz#1475237 *** This bug has been marked as a duplicate of bug 1475237 ***