Bug 30131

Summary: Command & Conquer 3 crashes with r300g
Product: Mesa Reporter: Martin Stolpe <martinstolpe>
Component: Drivers/Gallium/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium CC: pavel.ondracka, sa
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: wine output when trying to start C&C 3
crash log
wine output

Description Martin Stolpe 2010-09-11 01:07:16 UTC
Created attachment 38618 [details]
wine output when trying to start C&C 3

When I try to start C&C 3 the game crashes during the starting of the game. See attached wine output.

Here are the software versions I use:
Kernel 2.6.35.4
Xorg-server 1.8.2
xf86-video-ati-git 966ac1be81da76c8aa4ea46b63f3ca5358a2c021
mesa-git 5ea092117fb607a5776f52d251f976c5691575c8
Comment 1 Sven Arvidsson 2010-09-11 06:30:18 UTC
Hi,

Can this bug be reproduced with the demo?
http://www.gamershell.com/download_17978.shtml

It seems to be working for me with git master and Wine 1.2.


System environment:
-- system architecture: 32-bit
-- Linux distribution: Debian unstable
-- GPU: RV570
-- Model: Asus EAX1950Pro 256MB
-- Display connector: DVI
-- xf86-video-ati: e9928fe036e9382fd7bc353f3f05531445f08977
-- xserver: 1.8.99.904 (1.9.0 RC 5)
-- mesa: 3ad3cbfb120efa74e77f838d9fd3f1212dd0e47b
-- drm: 23287f05cf2443ddf9e028e29beb5bd30979c6cf
-- kernel: 2.6.35
Comment 2 Martin Stolpe 2010-09-12 15:29:08 UTC
Created attachment 38655 [details]
crash log

The demo crashes the xorg server.
mesa is at git version 5ea092117fb607a5776f52d251f976c5691575c8
Comment 3 Marek Olšák 2010-09-13 00:35:43 UTC
What's your GPU?
Comment 4 Martin Stolpe 2010-09-13 00:57:41 UTC
It's a X1400 in a T60 notebook.
Comment 5 Marek Olšák 2010-12-17 04:56:40 UTC
Martin, is this still an issue with current Mesa git and latest wine?
Comment 6 Martin Stolpe 2010-12-22 12:47:13 UTC
Created attachment 41378 [details]
wine output

Unfortunately this is still a problem with the latest mesa git.
Comment 7 Marek Olšák 2010-12-22 13:21:40 UTC
The game should not crash the X server. If it does, you are probably using indirect rendering, which might happen with 32-bit apps on x86_64 systems. Indirect rendering is buggy, slow, contains only a subset of features r300g offers, and gets very little testing AFAIK. So please make sure the game uses direct rendering. I should mention that using a 32-bit system may help.
Comment 8 Martin Stolpe 2010-12-23 04:25:51 UTC
Hello Marek,

(In reply to comment #7)
> The game should not crash the X server.
It doesn't crash the X server. The game tries to start but it will crash right before it is supposed to switch to the graphical full screen mode.

> indirect rendering, which might happen with 32-bit apps on x86_64 systems.
The system is a 32 bit system

> Indirect rendering is buggy, slow, contains only a subset of features r300g
> offers, and gets very little testing AFAIK. So please make sure the game uses
> direct rendering. I should mention that using a 32-bit system may help.
Where can I check what type of rendering I'm using. Should it be mentioned in the Xorg.log? I'm not at the system right now so I can't look.
Comment 9 Marek Olšák 2010-12-23 04:37:22 UTC
Then you are most probably using direct rendering. Could you possibly obtain a backtrace (i.e. call stack) of the crash?
Comment 10 Martin Stolpe 2010-12-23 12:40:36 UTC
(In reply to comment #9)
> Then you are most probably using direct rendering. Could you possibly obtain a
> backtrace (i.e. call stack) of the crash?

I've tried to switch on wine_d3d, x11drv, x11settings, xrandr, xrender and xvidmode debug channels in wine, but the resulting log file doesn't seem to give any hints about the error (if you're interested I can upload the log file).

Are there any other debug settings which I can turn on, which could help you identifying the cause of the crash?
Comment 11 Pavel Ondračka 2010-12-23 13:26:15 UTC
> Are there any other debug settings which I can turn on, which could help you
> identifying the cause of the crash?

You may find some useful info about obtaining backtraces with Wine here:
http://wiki.winehq.org/Backtraces
Comment 12 Marek Olšák 2011-02-10 17:43:30 UTC
Is this issue still present with the current Mesa master branch?
Comment 13 Martin Stolpe 2011-02-11 08:42:16 UTC
I've compiled mesa from git today and the error is still the same.
Comment 14 Marek Olšák 2011-02-11 09:33:17 UTC
Too bad there's nothing I can do without the backtrace.
Comment 15 Martin Stolpe 2011-02-11 11:15:40 UTC
(In reply to comment #14)
> Too bad there's nothing I can do without the backtrace.

Sorry, I overlooked your comment about using winedebug. Here is the output from winedebug:

Wine-dbg>set $BreakOnFirstChance=0 
Wine-dbg>cont
fixme:imm:ImmDisableTextFrameService Stub
fixme:thread:SetThreadIdealProcessor (0x9c): stub
fixme:thread:SetThreadIdealProcessor (0x134): stub
fixme:thread:SetThreadIdealProcessor (0x138): stub
fixme:d3d9:D3DPERF_GetStatus (void) : stub
fixme:win:EnumDisplayDevicesW ((null),0,0x335e878,0x00000000), stub!
wine: cannot find L"C:\\windows\\system32\\ShaderAssetBuilder.exe"
fixme:font:WineEngAddFontResourceEx Ignoring flags 30
fixme:dsalsa:IDsDriverBufferImpl_SetVolumePan (0x159690,0x15e158): stub
fixme:faultrep:ReportFault 0x335efd4 0x0 stub
err:mmtime:TIME_MMTimeStop Timer still active?!
Process of pid=002f has terminated
Comment 16 Pavel Ondračka 2011-02-11 12:57:52 UTC
I've found my copy of C&C3 so I thought I'll try to reproduce this. However I don't get any crash at startup. I get a crash when switching desktops or alt-tabing from game, but backtrace doesn't show any signs of a driver crash, so this is probably some unrelated Wine or C&C3 crash.

Martin, here is what I found when looking into this that you may find useful. IMHO you aren't getting backtrace because the crash is happening in some other process. You need to start the game, switch to terminal, start winedbg, list process, attach to the right one (probably cnc3game.dat or some other) and trigger the crash. Hopefully you will get some backtrace then.
Comment 17 Martin Stolpe 2011-02-12 00:55:54 UTC
Hi Marek,

thanks a lot for your effort in investigating the problem! I can't attach winedebug because the game crashes right after the splash screen that means that the game is loading for a few seconds before it crashes. I've tried to list the processes during the startup but haven't seen cnc3game.dat in the process list. I'm going to install the game into a clean WINEPREFIX to see what happens then.
Comment 18 Martin Stolpe 2011-02-13 10:03:49 UTC
I've created a new wine bottle and installed the game there. I've also disabled sounds with winecfg as suggested in the wine appDB. Now the game loads just after the splash screen. After the splash screen the game goes to full screen mode but the screen contents is gabled.

I've uploaded my PKGBUILD here: http://aur.pastebin.com/Y7bzfPdV

The commented lines is the configuration I was using before and below is my current configuration for mesa. Marek, can you post your configuration options for mesa so that I can compare if you're using different compile options?

I've also tried to compile mesa with the classic r300 driver and the game doesn't work either (behaviour is exactly the same as with the gallium driver). If I remember correctly the game was running with the classic driver although there were some heavy artifacts in the game appearing. So probably I'm missing something else...

I'll try again with the original packages from my distro and then report back.
Comment 19 Martin Stolpe 2011-02-13 12:21:16 UTC
Ok, it works with the packages from my distro. Still I have no idea what went wrong. I will play a little bit more with mesa and see if I stumble on anything useful on why this wasn't working...
Comment 20 Martin Stolpe 2011-02-16 14:38:41 UTC
I've found the culprit for the problem and reopened the bug because of this. Perhaps it's worth opening a new bug or report a bug for gcc. The problem is the following:
-I'm running Archlinux 32 Bit
-When I use "-mfpmath=sse" as an option for my CFLAGS and CXXFLAGS the game will crash. Only exception is when I select a processor type which doesn't support SSE as "-march" option. "-mmmx", "-msse", "-msse2" and "-msse3" have no influence on the behaviour (I'm not sure if those options are only valid when used in conjunction with some other option?)
Comment 21 Marek Olšák 2011-02-16 16:11:48 UTC
I guess it should be filed as a gcc bug. Does any other version of gcc work with the switch?
Comment 22 Matt Turner 2011-02-16 17:42:25 UTC
(In reply to comment #20)
> -When I use "-mfpmath=sse" as an option ...

This flag is not going to make anything faster. Don't use it. (Citation: I'm a Gentoo developer.)
Comment 23 Martin Stolpe 2011-02-17 11:56:59 UTC
Ok, so obviously this doesn't seem to be a mesa bug. So I think this bug report can be closed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.