http://bugs.winehq.org/show_bug.cgi?id=29552
Bug #: 29552 Summary: Tropico 3 installer crashes with -fno-omit-frame-pointer Product: Wine Version: 1.3.31 Platform: x86 URL: http://www.fileplanet.com/204947/200000/fileinfo/Tropi co-3-Demo OS/Version: Linux Status: NEW Keywords: download, Installer, regression Severity: normal Priority: P2 Component: build-env AssignedTo: wine-bugs@winehq.org ReportedBy: gyebro69@gmail.com CC: austinenglish@gmail.com Classification: Unclassified Regression SHA1: 5cfe7db1854ff1142d598eaf49f6050676c8d547
Created attachment 38287 --> http://bugs.winehq.org/attachment.cgi?id=38287 terminal output
The installer for Tropico 3 crashes near at the end of installation when Wine was compiled with cflags="-fno-omit-frame-pointer". The crash doesn't happen if I compile Wine with cflags=-O0 or -O1. The crash occurs with the default -O2.
5cfe7db1854ff1142d598eaf49f6050676c8d547 is the first bad commit commit 5cfe7db1854ff1142d598eaf49f6050676c8d547 Author: Austin English austinenglish@gmail.com Date: Tue Oct 18 12:17:37 2011 -0700
configure: Use -fno-omit-frame-pointer when available.
:100755 100755 7325264e829e7367e212bfda3b779fe4c8ea486e 138fa8d9a14bf240d0ee68a23aab2a97c4209ea0 M configure :100644 100644 5a9fd2ba1d4119695c1f811df67800f3144c4072 363d08f8076bce38fb75b689f076f13864725a4d M configure.ac
Other bug related to this commit: bug #28938
Cflags used on my system when compiling Wine from source (from the generated Makefile): ... CFLAGS = -g -gdwarf-2 -O2 EXTRACFLAGS = -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -Wlogical-op ...
Fedora 16 x86 gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC)
http://bugs.winehq.org/show_bug.cgi?id=29552
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Version|1.3.31 |1.3.36
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-01-07 05:06:09 CST --- Hello,
from the backtrace it looks you are using Wine 1.3.36
I have the same system specs except my Fedora 16 is 64/32 bit multilib and build daily from source. The game installs fine in clean WINEPREFIX.
Omitting frame pointer usually makes things worse but not the other way around. Make sure you are using a clean source tree for building (from GIT).
$ sha1sum Tropico3Demo.exe e031749db346ac3a87a675787c81eb1ca8cb5909 Tropico3Demo.exe
$ wine --version wine-1.3.36-172-gb00e703
Regards
http://bugs.winehq.org/show_bug.cgi?id=29552
--- Comment #2 from GyB gyebro69@gmail.com 2012-01-07 05:22:59 CST --- (In reply to comment #1)
Hello,
from the backtrace it looks you are using Wine 1.3.36
I have the same system specs except my Fedora 16 is 64/32 bit multilib and build daily from source. The game installs fine in clean WINEPREFIX.
Omitting frame pointer usually makes things worse but not the other way around. Make sure you are using a clean source tree for building (from GIT).
$ sha1sum Tropico3Demo.exe e031749db346ac3a87a675787c81eb1ca8cb5909 Tropico3Demo.exe
$ wine --version wine-1.3.36-172-gb00e703
Regards
The same problem with wine-1.3.36-172-gb00e703.
http://bugs.winehq.org/show_bug.cgi?id=29552
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|build-env |shell32
--- Comment #3 from Anastasius Focht focht@gmx.net 2012-01-07 14:15:41 CST --- Hello GyB,
--- quote --- The crash occurs with the default -O2. --- quote ---
Ok, I was building with default compiler settings but not Fedora distribution compiler flags ("rpm --eval %{optflags}" -> "-g -O2") hence I didn't get the crash. The optimization level leads to different stack usage/local variable values so "-fomit-frame-pointer" actually hides another bug.
The problem is hidden in shell32 get_known_folder_path_by_id()
The installer calls IKnownFolder::GetPath() but doesn't initialize the out parameter explicitly (lives on stack some frames up). Depending on previous calls stack usage there is a chance to encounter garbage.
It looks for game tasks folder using IKnownFolderManager as part of gameux registration. "C:\users\Public\Microsoft\Windows\GameExplorer" doesn't exist in clean WINEPREFIX.
--- snip --- Wine-dbg>bt Backtrace: =>0 0x739da051 SHGetFolderPathAndSubDirW+0x5e1(hwndOwner=(nil), nFolder=0x58, hToken=0x0(nil), dwFlags=0, pszSubPath=0x0(nil), pszPath="C:\users\Public\Microsoft\Windows\GameExplorer") [/home/focht/projects/wine/wine-git/dlls/shell32/shellpath.c:2252] in shell32 (0x00f5e384) 1 0x739da8f1 SHGetFolderPathW+0x40(hwndOwner=(nil), nFolder=0x58, hToken=0x0(nil), dwFlags=0, pszPath="C:\users\Public\Microsoft\Windows\GameExplorer") [/home/focht/projects/wine/wine-git/dlls/shell32/shellpath.c:2086] in shell32 (0x00f5e3b4) 2 0x739dcb71 SHGetKnownFolderPath+0x1d0(rfid=0x168218, flags=0, token=0x0(nil), path=0xf5e760) [/home/focht/projects/wine/wine-git/dlls/shell32/shellpath.c:3033] in shell32 (0x00f5e624) 3 0x739dcd9b get_known_folder_path_by_id+0x18a(folderId=0x168218, lpRegistryPath=<internal error>, dwFlags=0, ppszPath=0xf5e760) [/home/focht/projects/wine/wine-git/dlls/shell32/shellpath.c:3511] in shell32 (0x00f5e6d4) 4 0x739dd67a knownfolder_GetPath+0x79(iface=0x168210, dwFlags=0, ppszPath=0xf5e760) [/home/focht/projects/wine/wine-git/dlls/shell32/shellpath.c:3534] in shell32 (0x00f5e724) 5 0x00f6625a in games (+0x6259) (0x00f5e774) --- snip ---
Because of this, the out parameter is never allocated/copied to.
Source: http://source.winehq.org/git/wine.git/blob/a603e9871e21888216672003e2455dfac...
If there was any regression it would be this commit:
http://source.winehq.org/git/wine.git/commitdiff/08186a9c26e954aea26ad0129ca...
which dereferenced "ppszPath" out parameter without looking at HRESULT value (from SHGetKnownFolderPath -> SHGetFolderPathW ...).
Regards
http://bugs.winehq.org/show_bug.cgi?id=29552
GyB gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |vshader@gmail.com Regression SHA1|5cfe7db1854ff1142d598eaf49f |08186a9c26e954aea26ad0129ca |6050676c8d547 |e35f24f18054e
--- Comment #4 from GyB gyebro69@gmail.com 2012-01-08 00:34:59 CST --- Thank you for the in-depth analysis Anastasius!
Now I can confirm that the installer crashes with commit 08186a..., and installation ends without problems with the commit prior to that when using -fno-omit-frame-pointer and -O2.
08186a9c26e954aea26ad0129cae35f24f18054e is the first bad commit commit 08186a9c26e954aea26ad0129cae35f24f18054e Author: Mariusz Pluciński vshader@gmail.com Date: Thu Jun 30 14:59:46 2011 +0200
shell32: Check for known folder existance.
:040000 040000 b3f8d21b18277ad943ac1b8d0f723d2fd967960f 8db8eca5b64afce8ab414dd5437335dbe3e19299 M dlls
Other bug related to this commit: bug #28516.
http://bugs.winehq.org/show_bug.cgi?id=29552
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b32b969eb6d13a60f59b9052807 | |d372a8bd448f7 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #5 from Austin English austinenglish@gmail.com 2012-02-08 17:59:10 CST --- http://source.winehq.org/git/wine.git/commitdiff/b32b969eb6d13a60f59b9052807...
Thanks Nikolay!
http://bugs.winehq.org/show_bug.cgi?id=29552
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |
--- Comment #6 from Austin English austinenglish@gmail.com 2012-02-08 18:00:14 CST --- (In reply to comment #5)
http://source.winehq.org/git/wine.git/commitdiff/b32b969eb6d13a60f59b9052807...
Thanks Nikolay!
Copy/paste fail...
http://bugs.winehq.org/show_bug.cgi?id=29552
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1|b32b969eb6d13a60f59b9052807 |8272045cd84c304c07ccc4273f1 |d372a8bd448f7 |cd544cd20b209 Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #7 from Austin English austinenglish@gmail.com 2012-02-08 21:30:24 CST --- This was fixed by http://source.winehq.org/git/wine.git/commitdiff/8272045cd84c304c07ccc4273f1..., however.
http://bugs.winehq.org/show_bug.cgi?id=29552
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2012-02-11 13:52:10 CST --- Closing bugs fixed in 1.4-rc3.
https://bugs.winehq.org/show_bug.cgi?id=29552
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.fileplanet.com/2 |https://web.archive.org/web |04947/200000/fileinfo/Tropi |/20210227141220/http://dl.4 |co-3-Demo |players.de/f1/pc2/tropico3/ | |Tropico3Demo.exe