Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DorpsGek opened this issue Apr 13, 2012 · 21 comments
Closed
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

mag103 opened the ticket and wrote:

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
http://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:

Crash.png blackless

Attachments

Reported version: 1.2.0-RC4
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/5151
@DorpsGek
Copy link
Member Author

mag103 wrote:

another crash

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11084

@DorpsGek
Copy link
Member Author

Rubidium wrote:

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:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11085

@DorpsGek
Copy link
Member Author

Zuu wrote:

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11087

@DorpsGek
Copy link
Member Author

mag103 wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11089

@DorpsGek
Copy link
Member Author

pinkieiknip wrote:

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!


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11091

@DorpsGek
Copy link
Member Author

Terkhen wrote:

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++


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11092

@DorpsGek
Copy link
Member Author

Zuu wrote:

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11095

@DorpsGek
Copy link
Member Author

TrueBrain wrote:

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)


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11176

@DorpsGek
Copy link
Member Author

mag103 wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11218

@DorpsGek
Copy link
Member Author

mag103 wrote:

still crashes in 1.2.1rc1 and nighths


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11222

@DorpsGek
Copy link
Member Author

Terkhen wrote:

The fix committed by Truebrain fixed the crashing issues for me. Can you please post crash.log, crash.dmp and crash.sav?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11223

@DorpsGek
Copy link
Member Author

mag103 wrote:

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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11224

@DorpsGek
Copy link
Member Author

mag103 wrote:

also when cutson windowed screen its also crashes


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11225

@DorpsGek
Copy link
Member Author

Terkhen wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11229

@DorpsGek
Copy link
Member Author

Terkhen wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11232

@DorpsGek
Copy link
Member Author

frosch wrote:

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11234

@DorpsGek
Copy link
Member Author

TrueBrain wrote:

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.

This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11260

@DorpsGek
Copy link
Member Author

Terkhen wrote:

Can you try if the problem is fixed in a recent nightly? A problem related to this one was fixed recently in trunk.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11376

@DorpsGek
Copy link
Member Author

mag103 wrote:

trying the nighty to check the bug fix or not


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11407

@DorpsGek
Copy link
Member Author

mag103 wrote:

seems be fixed


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151#comment11408

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Requested by user


This comment was imported from FlySpray: https://bugs.openttd.org/task/5151

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant