WineHQ
Bug Tracking Database – Bug 34177

 Bugzilla

 

Last modified: 2013-11-15 13:40:47 UTC  

-pipe makes mingw-g++ work unreliably

Bug 34177 - -pipe makes mingw-g++ work unreliably
-pipe makes mingw-g++ work unreliably
Status: CLOSED FIXED
AppDB: Show Apps affected by this bug
Product: Wine
Classification: Unclassified
Component: msvcrt
1.6-rc5
x86 Linux
: P2 normal
: ---
Assigned To: Piotr Caban
http://downloads.sourceforge.net/proj...
: download, patch, source
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-07-31 14:04 UTC by Ruslan Kabatsayev
Modified: 2013-11-15 13:40 UTC (History)
1 user (show)

See Also:
Regression SHA1:
Fixed by SHA1: 089cc7818299c0d8f6a2fa726d205db25aad895f
Distribution: ---
Staged patchset:


Attachments
Test case (193.36 KB, application/x-bzip)
2013-07-31 14:04 UTC, Ruslan Kabatsayev
Details
Second test case (326.34 KB, application/x-bzip)
2013-07-31 17:56 UTC, Ruslan Kabatsayev
Details
mark stdin as console handle (4.63 KB, text/plain)
2013-08-06 11:46 UTC, Piotr Caban
Details
second patch (1.59 KB, patch)
2013-08-06 11:47 UTC, Piotr Caban
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Kabatsayev 2013-07-31 14:04:36 UTC
Created attachment 45461 [details]
Test case

How to reproduce:
1. Install mingw from mingw-get-inst-20120426.exe, use default settings. Don't pay attention at log clean error.
2. Do 
mingw-get upgrade "gcc<4.7"
mingw-get upgrade "g++<4.7"
(these are versions which should work for Qt-based apps; not sure if "gcc" line is actually needed)
3. Unpack attached test case
4. Now either run build.bat from "wine cmd" there, being inside the test directory, or run:
wine c:/mingw/bin/g++ -c -pipe -O2 -o mainwindow.o mw-processed.cpp
(you don't need to install Qt since the test file is a c++-preprocessed version, resulting from running "g++ -E")
5. Get the following error:
{standard input}: Assembler messages:
{standard input}:5343: Error: junk `(%esp)movl $0' after expression
{standard input}:5343: Error: too many memory references for `mov'
6. Remove "-pipe" from command, and this works with the same assembly code.
This all is quite sensitive to assembly code generated, e.g. remove "-O2" and you don't reproduce the bug; remove some lines from source — and again not reproduced...

Corresponding assembly code which causes the error (from changing "-c" to "-S"), from line 5343:
    movl    %eax, 16(%esp)
    movl    $0, 12(%esp)
Seems previous line appears partially (starting from "(") on the next one, and second one is truncated starting from ",".
I'm not sure what component has this bug, seems this is related either to string manipulation, or piping data between apps.
Comment 1 Ruslan Kabatsayev 2013-07-31 14:06:38 UTC
URL field in the bug has link to mingw installer.
Also have to say that this test case works correctly in windows, so this must be a bug in wine, not mingw.
Comment 2 Ruslan Kabatsayev 2013-07-31 16:13:34 UTC
A bisection for this particular test case revealed commit 027d9852105d515196f7c6271d76b8c5316e47cd, which modifies msvcrt. So setting component to msvcrt for now until proved wrong.

Note: This still shouldn't be considered a regression because before this commit another projects still fail to build with similar errors (junk data in assembly code). I.e. I can't yet be sure that this has worked at any previous version.

So, to check a future fix this test case is not enough — several more projects have to be checked.
Comment 3 Ruslan Kabatsayev 2013-07-31 17:56:49 UTC
Created attachment 45469 [details]
Second test case

Here's another test case, which fails before commit 027d9852105d515196f7c6271d76b8c5316e47cd (when first one doesn't). Seems these two test cases are enough to check potential fixes for this bug. This should be compiled with similar options as for first file.
Comment 4 Piotr Caban 2013-08-06 11:46:38 UTC
Created attachment 45520 [details]
mark stdin as console handle
Comment 5 Piotr Caban 2013-08-06 11:47:46 UTC
Created attachment 45521 [details]
second patch

I'm attaching patches that should fix this bug. Does it work with them for you?

(You need to apply both of them, I'm going to send it to wine when Alexandre is back from vacation)
Comment 6 Ruslan Kabatsayev 2013-08-06 12:15:50 UTC
Yes, they fix it.
Comment 7 Piotr Caban 2013-08-21 15:18:55 UTC
Fixed by f42c631d6e1b5c6cc16de4d329f29141dea47518 and 089cc7818299c0d8f6a2fa726d205db25aad895f commits.
Comment 8 Alexandre Julliard 2013-08-30 13:06:34 UTC
Closing bugs fixed in 1.7.1.
Comment 9 Alexandre Julliard 2013-11-15 13:40:47 UTC
Removing 1.6.x milestone from bugs included in 1.6.1.


Privacy Policy
If you have a privacy inquiry regarding this site, please write to [email protected]

Hosted By CodeWeavers