Opened 11 years ago

Closed 10 years ago

#2146 closed defect (fixed)

Crash (assertion) after sleep mode

Reported by: AntonBazhal Owned by:
Priority: Should Have Milestone: Alpha 17
Component: Core engine Keywords:
Cc: Patch:

Description

Steps to reproduce the bug:

  1. Pause the game
  2. Go to sleep mode
  3. Wake up
Assertion failed: "status == DISP_CHANGE_SUCCESSFUL"
Location: wsdl.cpp:436 (SDL_SetVideoMode)

Call stack:

00CEA2D5

00CEE099

00BC3AF7

00BC4457

00BC5875

00CEA340

00CED2F3

00CED9AF

00CEDC30

00CEDC68

00B21D99

00B22595

00B23055

00B230D5

00CE9995

00CE988F


errno = 13 (Insufficient access rights to open file)
OS error = 0 (no error code was set)

Change History (4)

comment:1 by historic_bruno, 10 years ago

This is reproducible for me on Win 7/64-bit with the game running fullscreen in a debugger; after putting the system to sleep and resuming, the game will have this error. The call stack is misleading, because the first failure occurs in WSDL's OnActivate handler, but then it tries to display an error message about that, which in turn attempts to change from fullscreen to windowed mode, causing a different error.

Here are the relevant parts:

 	pyrogenesis_dbg.exe!SDL_SetVideoMode(int w=1040, int h=806, int bpp=32, unsigned int flags=2)  Line 436 + 0x3a bytes	C++
 	pyrogenesis_dbg.exe!CVideoMode::SetVideoMode(int w=1024, int h=768, int bpp=32, bool fullscreen=false)  Line 150 + 0x15 bytes	C++
 	pyrogenesis_dbg.exe!CVideoMode::SetFullscreen(bool fullscreen=false)  Line 416 + 0x19 bytes	C++
 	pyrogenesis_dbg.exe!psDisplayError(const wchar_t * __formal=0x0a860000, const wchar_t * __formal=0x0a860000)  Line 407	C++
 	pyrogenesis_dbg.exe!ah_display_error(const wchar_t * text=0x0a860000, unsigned int flags=6)  Line 178 + 0x10 bytes	C++
 	pyrogenesis_dbg.exe!CallDisplayError(const wchar_t * text=0x0a860000, unsigned int flags=6)  Line 375 + 0xd bytes	C++
 	pyrogenesis_dbg.exe!debug_DisplayError(const wchar_t * description=0x0b1d0460, unsigned int flags=6, void * context=0x002feac0, const wchar_t * lastFuncToSkip=0x0b1c8dd0, const wchar_t * pathname=0x0165faf8, int line=834, const char * func=0x0165faec, volatile int * suppress=0x017bdfd8)  Line 469 + 0xd bytes	C++
 	pyrogenesis_dbg.exe!debug_OnAssertionFailure(const wchar_t * expr=0x0165fb50, volatile int * suppress=0x017bdfd8, const wchar_t * file=0x0165faf8, int line=834, const char * func=0x0165faec)  Line 558 + 0x31 bytes	C++
>	pyrogenesis_dbg.exe!OnActivate(HWND__ * hWnd=0x005a0792, unsigned int state=0, HWND__ * __formal=0x00000000, int fMinimized=0)  Line 834 + 0x24 bytes	C++
 	pyrogenesis_dbg.exe!OnMessage(HWND__ * hWnd=0x005a0792, unsigned int uMsg=6, unsigned int wParam=0, long lParam=0)  Line 1286 + 0x34 bytes	C++
 
        ...

The return code in both cases is DISP_CHANGE_BADPARAM, MSDN has the following to say about it:

An invalid parameter was passed in. This can include an invalid flag or combination of flags.

I don't see how the parameters could be invalid, maybe the call itself isn't allowed. It could be related to #1196/#1733, as Windows resumes at the login screen, but the return code is different.

comment:2 by historic_bruno, 10 years ago

Also, note that pressing Continue to close the error window is a sufficient workaround.

Next time I'm testing SDL 2.0 on Windows, I will try reproducing this.

comment:3 by ben, 10 years ago

In 14325:

Improves debugging output to help troubleshoot some WSDL bugs, refs #2146, #1733

comment:4 by historic_bruno, 10 years ago

Milestone: BacklogAlpha 17
Resolution: fixed
Status: newclosed

SDL2 fixes this and is now the default on Windows as of r15786.

Note: See TracTickets for help on using tickets.