0xC0000005 exception

Started by Radiant, Wed 02/03/2016 12:38:29

Previous topic - Next topic

Radiant

A player of Heroine's Quest reports the following exception whenever his character dies:

An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00469208 ; program pointer is +77, ACI version 3.3.0.1162, gtags (46,1)

I've asked him for the crashinfo file; any thoughts on what this could be?

Radiant


Scavenger

Whenever his character what?

0xC0000005 is "Access Violation", most often done when you're trying to read/write outside of the bounds of a dynamic array.

AGS has it's own exception handler for it's AGS script, so it can't be a script error unless something has gone horribly wrong. Does Heroine's Quest use any plugin functions around the area it crashes?

Crimson Wizard

#3
I kind of suspected that; it is again an error you get in windowed Direct3D mode when the game is trying to capture screen contents.
This time it does so not for screenshot, but for fade-in/out effect.

Earlier we had this error only when the window was moved or minimized/restored during screen capture; I cannot deduce how this may be related to character death...

Radiant

Interesting.

Well, looking over the HQ code, one thing that stands out in die Die() function is this: SetScreenTransition (eTransitionCrossfade); Could that be the cause?

Crimson Wizard

Quote from: Radiant on Sun 06/03/2016 14:49:36
Well, looking over the HQ code, one thing that stands out in die Die() function is this: SetScreenTransition (eTransitionCrossfade); Could that be the cause?
"Crossfade" transition makes a screenshot of current room to use during fade animation, so it might be.

Radiant

#6
The player confirms that either switching to fullscreen mode or setting graphics driver to DDraw 5 solves the problem. Thanks for the info!

Gradir

Yes I recently changed my game's resolution in editor to higher (from 800x600 to 1280x720), now it only works in fullscreen mode.
I'm using 3.4.0.11 (RC2)

Any help?
Cheers

Crimson Wizard

Quote from: Gradir on Fri 23/09/2016 22:49:33
Yes I recently changed my game's resolution in editor to higher (from 800x600 to 1280x720), now it only works in fullscreen mode.
I'm using 3.4.0.11 (RC2)

Any help?
Cheers

Gradir, first of all, why did you post in this forum thread? Was this a mistake, or your problem somehow related to the Radiant's problem (0xC0000005 exception)? (If first, moderator can move this post into new thread)
Secondly, could you be more elaborate, like what exactly happens? Is there any error message when you try to run it windowed? What is your monitor default resolution, and which config settings do you use?

Gradir

#9
I'm pretty sure it's related to the problem, as stated in previous post
( The player confirms that either switching to fullscreen mode or setting graphics driver to DDraw 5 solves the problem. Thanks for the info! )

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x004C8A00 ; program pointer is -3, ACI version 3.4.0.11, gtags (59,156)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and post the details on the AGS Technical Forum.

crash dump: http://ctapart.pl/CrashInfo.3.4.0.11.dmp


My monitor's default and using res is 1366x768. I have no problem with fullscreen of 1280x720, but the windowed mode doesn't seem to work. Earlier there were no problems with 800x600. Changing from Direct Draw to D3D9 doesn't do anything either

Crimson Wizard

#10
These crash dumps AGS creates are stripped of most program data (to minimize the size), so they are not 100% reliable, but this is what I can currently see.

The crash occurs right before loading first room, when the game is trying to play "fade-out" (darkening) effect.
There are also suspicious arguments used when drawing this darkening effect, which I need to investigate more (bitmap source is being stretched with negative coordinates).

Just to be sure that this is connected to fade-out, could you check what will happen if you go to General Settings and change default room transition to "Instant"?

Also, it would be great to know the exact size of the game window that is created for you to perform more accurate test. If you go to the Compiled folder of your project, edit acsetup.cfg (with simple text editor) and put the line "log=1" under "[misc]" section, then build and run the game, the log file should appear at "%USERPROFILE%\Saved Games\.ags". If you have time, could you do that and post log's contents, starting from message "Initializing resolution settings"?



Gradir

#11
Changing room-transition to instant fixes the problem!
It actually works with all except fade-out-fade-in!

You really are a Wizard,
I was trying to make the more detailed log, but putting log=1 under [misc] in all the configs doesn't make a log file appear where You said!

Also, switching to D3D9 works.
I thought it doesn't work since I was changing it in the editor and it didn't help.

Crimson Wizard

#12
Something weird is going on with the log... this is second time when people say it does not appear. Which operating system are you using? On Windows you should be able to type "%USERPROFILE%\Saved Games" in the Explorer (in the text box where it displays current path) and pressing enter will get you to user's Saved Games folder. Are not there any ".ags" subfolder in there?

Anyway, since you can run it in window already, you may just start the game and press Ctrl+V or Ctrl+Alt+V to display information on window size (and few other things).

Crimson Wizard

Gradir, I was not able to reproduce your crash, probably I'd need to know more about config you use.
However, while testing something different I found couple of mistakes that could lead to very similar error in rare cases. I made a patch, and the new engine version is available for download from our build server:
http://teamcity.bigbluecup.org/repository/download/AdventureGameStudio_EngineRelease/18322:id/engine.zip

Could you replace acwin.exe in your AGS Editor directory (make a backup of old one of course), change your game back to fade-out transition and check whether error has gone or still occuring?

m0ds

Just tracking another one of these. Going to suggest it's crossfades or such and to try a different gfx filter, but want to check with you first in case this has information in it that I don't know about!

"An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x0041887F ; program pointer is +3330, ACI version 3.3.3.0, gtags (0,0)"

Any hint on what +3330 is please CW? Although that seems to be the ACI version no, not like  +157 where you mentioned previously "Program pointer +157 is in DisplaySpeech function". Thanks!

Crimson Wizard

#15
Quote from: MJL on Fri 20/10/2017 05:26:17
"An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x0041887F ; program pointer is +3330, ACI version 3.3.3.0, gtags (0,0)"

Finding the "program pointer" location is not difficult usually, because they are often unique numbers; you just run search in engine sources. The "3330" is pointing to this chunk of code:

(functions is "prepare_characters_for_drawing")
Code: ags

        our_eip = 3330;
        int isMirrored = 0, specialpic = sppic;
        bool usingCachedImage = false;

        coldept = spriteset[sppic]->GetColorDepth();

        // adjust the sppic if mirrored, so it doesn't accidentally
        // cache the mirrored frame as the real one
        if (views[chin->view].loops[chin->loop].frames[chin->frame].flags & VFLG_FLIPSPRITE) {
            isMirrored = 1;
            specialpic = -sppic;
        }

        our_eip = 3331;


But from this point one may only make assumptions. There are several arrays accessed in sequence: sprite array, views (frames, loop) array.
"sppic" variable is an index which is assigned right above this code:
Code: ags

sppic=views[chin->view].loops[chin->loop].frames[chin->frame].pic;"


For example, could this occur if the "pic" in the character frame was an index of dynamic sprite which got deleted in a wrong time?
(Unfortunately there are a lot of places in AGS where it does not check for validity of sprite before using returned pointer.)

m0ds

Thanks. What you're saying does make sense. We have had a problem with a sprite number that doesn't exist or similar being called and the game crashing, so I guess this is one and the same. Never really found where though, as you say, this is a program pointer that isn't really pointing anywhere specific in our code to be able to troubleshoot it. But yes, it's highly likely we try to flip a sprite and the flipped frame doesn't exist or something. Thank you!

SMF spam blocked by CleanTalk