OpenTTD

Tasklist

FS#5151 - [Windows] Game Crash when attempt start the game with 32BPP graphics set

Attached to Project: OpenTTD
Opened by maz (mag103) - Friday, 13 April 2012, 18:13 GMT
Last edited by frosch (frosch) - Sunday, 22 July 2012, 09:15 GMT
Type Bug
Category Core
Status Closed
Assigned To maz (mag103)
Operating System Windows
Severity Critical
Priority Normal
Reported Version 1.2.0-RC4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
  • maz (mag103) (2012-06-26)
Private No

Details

I downloaded the 8/32bpp Trains 2CC from BANANAS
to try out the new 32 Extra zoom NEWGRF
but I Tried start the game

First reported crash in TTFourms
https://www.tt-forums.net/viewtopic.php?f=67&t=59332&start=20

Loaded NewGRFs

8/32bpp Trains 2CC
OPENGRX 32bmp Nightlys

To do the crash

Set your Openttd Fullscreen below 1920-1200

1. Download the 8/32bpp Trains 2CC from BANANAS ( Skip if you got this)
2. Load the 8/32bpp Trains 2CC
3. Go to New Game
4. Press Generate
5. Crash

Windows XP SP3 32bit

Crash reason:
Exception: C0000005
Location: 005879C0
Message: <none>

Crash.png blackless
This task depends upon

Closed by  frosch (frosch)
Sunday, 22 July 2012, 09:15 GMT
Reason for closing:  Requested by user
Comment by maz (mag103) - Friday, 13 April 2012, 18:16 GMT
another crash
Comment by Remko Bijker (Rubidium) - Friday, 13 April 2012, 20:06 GMT
FAULTING_IP:
openttd!Blitter_32bppAnim::Draw+9b4 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\blitter\32bpp_anim.cpp @ 208]
005879c0 8b07 mov eax,dword ptr [edi]

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
.exr 0xffffffffffffffff
ExceptionAddress: 005879c0 (openttd!Blitter_32bppAnim::Draw+0x000009b4)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: c2955de6
Attempt to read from address c2955de6

PROCESS_NAME: openttd.exe

ADDITIONAL_DEBUG_TEXT:
Use '!findthebuild' command to search for the target build information.
If the build information is available, run '!findthebuild -s ; .reload' to set symbol path and load symbols.

MODULE_NAME: openttd

FAULTING_MODULE: 7c900000 ntdll

DEBUG_FLR_IMAGE_TIMESTAMP: 4f7781f9

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".

EXCEPTION_PARAMETER1: 00000000

EXCEPTION_PARAMETER2: c2955de6

READ_ADDRESS: c2955de6

FOLLOWUP_IP:
openttd!Blitter_32bppAnim::Draw+9b4 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\blitter\32bpp_anim.cpp @ 208]
005879c0 8b07 mov eax,dword ptr [edi]

MOD_LIST: <ANALYSIS/>

FAULTING_THREAD: 0000074c

BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_READ_WRONG_SYMBOLS

PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ

DEFAULT_BUCKET_ID: INVALID_POINTER_READ

LAST_CONTROL_TRANSFER: from 0041e677 to 005879c0

STACK_TEXT:
0013e0bc 0041e677 0013e0dc 000001dd 083107c2 openttd!Blitter_32bppAnim::Draw+0x9b4 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\blitter\32bpp_anim.cpp @ 208]
0013e128 0041dbbc 00000b44 00000774 00000000 openttd!GfxMainBlitter+0x572 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\gfx.cpp @ 1425]
0013e148 0041ec2c 00000000 000002d1 000001dd openttd!DrawSprite+0x88 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\gfx.cpp @ 1221]
0013e168 00463e12 00c7ea58 00c521c0 0013e180 openttd!DrawMouseCursor+0x148 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\gfx.cpp @ 1689]
0013e180 005d8d2b 00000000 00000005 00000780 openttd!UpdateWindows+0x132 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\window.cpp @ 2625]
0013e190 005d9324 0013e270 005d91ec 00000000 openttd!ClientSizeChanged+0x58 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\video\win32_v.cpp @ 194]
0013e204 0013e234 7e418734 00030148 00000005 openttd!WndProcGdi+0x138 [c:\bamboo-agent-home\xml-data\build-dir\ottd-rls-w32bit\src\video\win32_v.cpp @ 636]
WARNING: Frame IP not in any known module. Following frames may be wrong.
0013e218 04b00780 005d91ec dcbaabcd 00000000 0x13e234
00000000 00000000 00000000 00000000 00000000 0x4b00780


STACK_COMMAND: ~0s; .ecxr ; kb

SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: openttd!Blitter_32bppAnim::Draw+9b4

FOLLOWUP_NAME: MachineOwner

IMAGE_NAME: openttd.exe
Comment by Leif Linse (Zuu) - Sunday, 15 April 2012, 11:36 GMT
I've followed your steps to reproduce with 1.2-RC4, but it did not crash. In my game I don't have any other NewGRFs than the one you suggested. I have not made any changes to the blitter settings in order to enable 32bit. Maybe that is required to reproduce your crash?


EDIT: Now I've tried to enable the 32bpp-anim blitter that you have been using, and also built one of the 32bpp engines in the game without it crashing. For the record I use Windows 7 64 bit, but the 32bit OpenTTD version.
Comment by maz (mag103) - Sunday, 15 April 2012, 18:57 GMT
Fullscreen 1200x800 i was using

Try Setting Screen resoluition

Its only crashes Openttd was fullscreen not windowed

but i was abled start the game windowed and swtich to fullscreen never crashed




Fullscreen Screen resoluition crash test

Theres i Fullscreen reolutions i tested

I tested few

640-480 crashed
1280-800 crashed

1920-1200 never crashed
Comment by pinkieiknip (pinkieiknip) - Monday, 16 April 2012, 08:53 GMT
I can confirm this bug, only occurs on 64-bit version, not in the 32-bit build. Running Windows 7 Ultimate x64.

Just tried 32-bit and then re-installed the 64-bit, now it works.

Same steps, just loaded it on maximized window; crashes, but does not crash when window is not maximized. Does not seem to occur when 32-bit version has been installed.

Also, the FPS of the title screen is very low (and CPU load maxed out) when I return from the game!
Comment by Jose Soler (Terkhen) - Monday, 16 April 2012, 18:35 GMT
  • Field changed: Status (New → Confirmed)
  • Field changed: Due in Version (Undecided → 1.2.1)
I managed to reproduce this issue using OpenTTD 1.2.0 stable (x64). OpenTTD only crashes for me when I start a game if it is maximized, it does not crash for me if it is windowed or fullscreen.


openttd.exe!Blitter_32bppAnim::Draw(Blitter::BlitterParams * bp, BlitterMode mode, ZoomLevel zoom) Line 208 + 0x88 bytes C++
openttd.exe!GfxMainBlitter(const Sprite * sprite, int x, int y, BlitterMode mode, const SubSprite * sub, unsigned int sprite_id, ZoomLevel zoom) Line 1425 C++
openttd.exe!DrawSprite(unsigned int img, unsigned int pal, int x, int y, const SubSprite * sub, ZoomLevel zoom) Line 1221 C++
openttd.exe!DrawMouseCursor() Line 1689 C++
openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 636 C++
Comment by Leif Linse (Zuu) - Tuesday, 17 April 2012, 20:52 GMT
I have a dual monitor setup which might affect me, but I am unable to reproduce the crash. I've used the 64 bit version of OpenTTD with the "32bpp-anim" blitter. I've clicked to start a new game both in non-maximized and maximized window as well as in full screen. I've also tried to temporarily change my display settings to only use one screen and start a new game in a maximized window.

However, me not being able to reproduce it is not the main problem here, but the actual crash. Good that three of you have been able to reproduce it.
Comment by Patric Stout (TrueBrain) - Monday, 30 April 2012, 14:53 GMT
For documentation purposes:

Preperation:

Change your openttd.cfg to read: blitter =
(so no default blitter)

Download any 32bpp grf, make one, generator one. Make it part of your set of grfs that is loaded when you start a new game.

Make sure OpenTTD starts not maximized, in a resolution below your screens.


Reproducing:

Start OpenTTD
Maximize
Start a new game


Enjoy the crash report.

Windows 7, x64, 1.2.0 (Release)
Comment by maz (mag103) - Thursday, 17 May 2012, 13:00 GMT
Still occcers in 1.2.1RC1

Loaded NewGRFs

8/32bpp Trains 2CC

To do the crash

Set your Openttd Fullscreen below 1920-1200

1. Download the 8/32bpp Trains 2CC from BANANAS ( Skip if you got this)
2. Load the 8/32bpp Trains 2CC
3. Go to New Game
4. Press Generate
5. Crash

Windows XP SP3 32bit

Mine its only crashs only below 1920-1200

If screen set 1920-1200 its wont crash but its have side effects like map loader blackless
Comment by maz (mag103) - Sunday, 20 May 2012, 09:41 GMT
still crashes in 1.2.1rc1 and nighths
Comment by Jose Soler (Terkhen) - Sunday, 20 May 2012, 15:01 GMT
The fix committed by Truebrain fixed the crashing issues for me. Can you please post crash.log, crash.dmp and crash.sav?
Comment by maz (mag103) - Wednesday, 23 May 2012, 14:21 GMT
its crash only in fullsceeen below 1920x1200 its wont crash in windowed , effects Map Loader coloured blacked.

if i go windowed start the game and exit the game then go full screen and start the game its never crashes
Comment by maz (mag103) - Friday, 25 May 2012, 00:12 GMT
also when cutson windowed screen its also crashes
Comment by Jose Soler (Terkhen) - Friday, 25 May 2012, 16:34 GMT
I can't reproduce the issue.

Stacktrace:

openttd.exe!Blitter_32bppAnim::Draw(Blitter::BlitterParams * bp, BlitterMode mode, ZoomLevel zoom) Line 208 + 0x551 bytes C++
openttd.exe!GfxMainBlitter(const Sprite * sprite, int x, int y, BlitterMode mode, const SubSprite * sub, unsigned int sprite_id, ZoomLevel zoom) Line 1425 C++
openttd.exe!DrawSprite(unsigned int img, unsigned int pal, int x, int y, const SubSprite * sub, ZoomLevel zoom) Line 1221 C++
openttd.exe!DrawMouseCursor() Line 1689 C++
openttd.exe!UpdateWindows() Line 2628 C++
openttd.exe!ClientSizeChanged(int w, int h) Line 194 C++
openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned int wParam, long lParam) Line 637 C++
openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned int wParam, long lParam) Line 751 C++
openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned int wParam, long lParam) Line 745 C++
openttd.exe!VideoDriver_Win32::MakeWindow(bool full_screen) Line 261 C++
openttd.exe!SwitchNewGRFBlitter() Line 245 + 0xb bytes C++
openttd.exe!MakeNewGame(bool from_heightmap, bool reset_settings) Line 912 + 0x34 bytes C++
openttd.exe!SwitchToMode(SwitchMode new_mode) Line 1030 C++
openttd.exe!GameLoop() Line 1387 C++
openttd.exe!VideoDriver_Win32::MainLoop() Line 1019 C++
openttd.exe!ttd_main(int argc, char * * argv) Line 833 C++
openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 451 + 0x9 bytes C++
openttd.exe!__tmainCRTStartup() Line 275 + 0x1c bytes C

EDIT: Stacktrace corrected
Comment by Jose Soler (Terkhen) - Friday, 25 May 2012, 19:15 GMT
One of the worker threads had a meaningful stacktrace.


openttd.exe!ThreadMutex_Win32::WaitForSignal() Line 139 C++
openttd.exe!PaintWindowThread(void * __formal) Line 415 + 0xb bytes C++
openttd.exe!ThreadObject_Win32::ThreadProc() Line 65535 C++
openttd.exe!ThreadObject_Win32::stThreadProc(void * thr) Line 77 C++
openttd.exe!_callthreadstartex() Line 314 + 0x6 bytes C
openttd.exe!_threadstartex(void * ptd) Line 292 + 0x5 bytes C
Comment by frosch (frosch) - Friday, 25 May 2012, 19:24 GMT
SwitchNewGRFBlitter() is called before the spritecache is reset and such (the new blitter will provide a different encoding for the cache). So the screen may not be redrawn as part of it. That must happen later.

So, if the GDI functions call back into ClientSizeChanged, that call might need suppress the redraw calls, if MakeWindow is running or so.
Comment by Patric Stout (TrueBrain) - Tuesday, 29 May 2012, 08:28 GMT
I do wonder why his Windows triggers an event mine doesn't, while we appear to have the same Windows.

Basically, with my last patch I tried to avoid Windows triggering silly events while we are moving from a 8bpp window to a 32bpp. This clearly seems to fail. Two options that might solve this issue for ever:

1) ignore all events from the window when we are changing it a bit.
2) ignore UpdateWindows() while we are moving from 8bpp to 32bpp. It has to be noted this is more tricky than it sounds, as code at the moment is not unified in these regards, and there is not a single place to add such code.
Comment by Jose Soler (Terkhen) - Saturday, 14 July 2012, 20:30 GMT
Can you try if the problem is fixed in a recent nightly? A problem related to this one was fixed recently in trunk.
Comment by maz (mag103) - Saturday, 21 July 2012, 18:19 GMT
trying the nighty to check the bug fix or not
Comment by maz (mag103) - Saturday, 21 July 2012, 18:29 GMT
seems be fixed

Loading...