Hidden Game.exe Crash Debugger - Graphical Object Global Reference ACE

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Mithran, Aug 26, 2013.

  1. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Won't help in this instance. This one only traces errors with relation to the disposal of sprites and related objects. I'll continue discussion in the other thread.
     
    #21
  2. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    First Language:
    English
    I didn't notice until now but there's a typo in the title.
     
    #22
    Girostrike likes this.
  3. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Thanks, got it fixed.
     
    #23
  4. The Yank

    The Yank Veteran Veteran

    Messages:
    101
    Likes Received:
    37
    Location:
    Australia
    First Language:
    English
    Does the script create a log file even when there's no error? Because I got a really long text file on my game, even though it hasn't crashed since I installed the script.
     
    #24
  5. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,544
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    I think it creates a log of "possible" error points, not a log of when you crash already
     
    Last edited by a moderator: Jan 16, 2014
    #25
  6. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    It logs any sprites in memory when the scene switches, which frequently means leaked sprites. Leaked sprites can either be harmless or create an instability that leads to a Game.exe crash with no associated script error (eg., nearly impossible to debug unless you know where to look). The same issue occurred in VX, but in ACE it is much less common (< 5% through personal tests, given an instability, and varies from computer to computer). It is still very important to not release scripts that can even potentially crash in the way described, as anyone not aware of the actual cause (explained in the original post) is going to waste hours looking for the cause or even abandon their project entirely. Just because you don't crash doesn't mean it will never crash.


    Also, this script uses a workaround to prevent the crashes entirely while it is installed. It does so by intentionally keeping the objects in memory that could otherwise cause a crash when destroyed, so it is not advisable to run like that.


    There are also a few scripts that 'false positive' due to how they work, but these are generally rare if the scripter followed standard practice as by default no sprites are held in memory between scenes.
     
    #26
    Chaos17 likes this.
  7. Quickdraws

    Quickdraws Veteran Veteran

    Messages:
    55
    Likes Received:
    8
    Location:
    Void
    First Language:
    English
    I've been having that occasional rgss3 player stop working and crash bug lately and was curious if you help me fix it. I've got it narrowed down to the line where the

    issue is occurring. I just have no clue how to go about disposing of it properly.

    I'm using a lightly modified Symphony Core which I included in the links below along with the other requirements you asked for. I'm using a dozen or so of yanfly scripts as well along with some fix scripts for bugs if it matters. 

    Basically when the battle starts it creates a shadow sprite for the enemy and players in a sideview battle but when the battle ends it isn't disposing. The undisposed graphic then gets repeated with each enemy or character with every new battle scene which adds up quickly.

    I've tried writing some dispose methods however my understanding of scripting is nominal at best. I keep getting no method errors and honestly I'm not sure where I should be disposing the offending sprites lol or really how to go about it. Any help would be appreciated.

    http://pastebin.com/bMtVQyqf - Symphony Core Line 1860 Sprite in need of proper disposal.

    http://pastebin.com/7uc02yPm - gobj.log

    https://www.dropbox.com/s/kqtujch3c76vjdx/Scripts.rvdata2 - rvdata2 for scripts. 
     
    #27
  8. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Thank you for taking the time to be thorough with your report. As it turns out, this one looks like an easy fix:

    Code:
    class Sprite_Battler < Sprite_Base  alias dispose_mith_yamisymphonyfix dispose  def dispose    @charset_shadow.dispose if @charset_shadow    dispose_mith_yamisymphonyfix   endend
    Install that on a page below the offending script for now. I will contact Yami directly to notify them of the problem.
     
    #28
    Chaos17 likes this.
  9. Quickdraws

    Quickdraws Veteran Veteran

    Messages:
    55
    Likes Received:
    8
    Location:
    Void
    First Language:
    English
    Awesome thanks for the super fast reply. Fix appears to work the console no longer is logging the error.

    I like to try to fix the issue myself most the time but after a  few hours with no success it's great to have so many knowledgeable people here willing to help others with their problems.  

    Hmm, I even tried to rewrite a dispose method pretty similar to that to that but it kept throwing a nomethod error.

    alias go_dispose dispose

      def dispose

        @charset_shadow.bitmap.dispose         

         go_dispose

      end

    end

    I see now I wasn't 2 far off from solving it myself. Lol just needed to add the if @charset_shadow part. And add the fix below the other script.

    Thank you very much.
     
    #29
  10. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Below or above wouldn't have mattered as long as nothing rewrote dispose for that class after that point, which I didn't see. Later method definitions will overwrite earlier ones, but if the original method is preserved through an alias chain, all we need to know is that the shadow is disposed before the sprite itself. Depending on if other things overwrite and how much the order things happens in matters, "below the offending script" is just generally my go-to place to tell people to place patches. It makes it easy to delete the patch when the original gets fixed, and it is generally the minimum safest place to put a patch. If something does a full overwrite of dispose below that script (not likely), it would have needed to be moved even more down the list more.


    The 'if @charset_shadow' provision was added because there are cases where the sprite does not get created, in which case the variable is nil when the dispose is attempted. Also, the sprite itself is what needed to be disposed to prevent the error, the bitmap doesn't matter in this case (it is cached in this case, anyway).


    The important thing is is that the dispose call is also missing in the original version of the script and I have notified Yami so it can be fixed permanently. Thank you for doing your part to combat this bug.
     
    #30
  11. Quickdraws

    Quickdraws Veteran Veteran

    Messages:
    55
    Likes Received:
    8
    Location:
    Void
    First Language:
    English
    Ah that makes sense now thanks for explaining.

    I've run into one more script which isn't disposing of its sprites properly but on a much worse scale. The Weather EX script by Moghunter.

    I was searching the forums and found a post by Galv saying this was fixed by Moghunter however that doesn't seem to be the case by the latest version of weather EX.

    http://forums.rpgmakerweb.com/index.php?/topic/11720-what-causes-rgss3-player-has-stopped-working-errors/?hl=moghunter#entry120388

    I've tested the weather script in a new project, in the moghunter demo, and with my script it all logs the same critical errors so I don't believe it's got anything to do with my scripts but here's the new logs and data. Best I can tell it has a proper dispose method but the console is logging a large amount of critical errors with every scene change.

    Anyhow any help would be appreciated I'm sure I not the only one who has run into problems with this script seems to be a popular one.

    http://pastebin.com/8LK9NhYp - Weather EX by Moghunter

    http://pastebin.com/JbiwFyse - Gobj Log

    https://www.dropbox.com/s/kqtujch3c76vjdx/Scripts.rvdata2 - New Script data
     
    #31
  12. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    I thought I tracked this one down a long time ago and posted a fix but on going through my records I can't find it. I don't immediately see the issue with a hand trace, either. I remember part of it being that the flow is all over the place and I believe something was getting double-created, but I'll have to run actual tests to find the actual problem so I wont be able to do it right away.
     
    #32
  13. Quickdraws

    Quickdraws Veteran Veteran

    Messages:
    55
    Likes Received:
    8
    Location:
    Void
    First Language:
    English
    No problem I've been trying to tinker with it in my spare time to find a fix. It rarely crashes since I've gotten all the other sprites properly disposed in my scripts this was just the last one on my list. Sorta saved the worst for last since I couldn't quite place the issue. Using moghunter memory clear script wipes the offending sprites away which fixes the problem temporarily only downfall is its method of doing so is incompatible with my Khas lighting script. Well I'm in no rush thanks for the reply and if you happen to find a solution lemme know.   
     
    #33
  14. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Found the issue. The array holding the sprites is being nullified before they are referenced before disposal. The disposal method does not run if the variable is nil (it wouldn't have anything to reference anyway) as a protection because the dispose method is normally called as part of the creation, so it would be legitimately nil on the first access. Ironically, this is the kind of structure was probably done to ensure all sprites would be disposed before the new ones are created, but masked the error because the nil value was expected.

    The fix is easy enough:

    module Module_Weather_EX def dispose_refresh $game_temp.weather_ex_set.clear return if @weather_ex == nil @weather_ex.each {|sprite| sprite.dispose_weather} #@weather_ex = nil # this array should not be nullified at this point, it has handled by dispose_weather_ex_sprite endendThe issue itself with this script is fairly catastrophic, actually. I think this was in the project that was originally given to me that crashed frequently enough to identify the Game.exe issue still existed in Ace in the first place, and I fixed it in line in that project which is why I couldn't find the fix.Unfortunately, I don't have a direct line of contact for Moghunter (couldn't find a contact link on their site), nor do I seem to speak the same language. There is some other stuff that I am logging in the Moghunter Master Demo so I would like to be able to contact them.
     
    #34
    Quickdraws likes this.
  15. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    Last edited by a moderator: Jan 22, 2014
    #35
  16. Quickdraws

    Quickdraws Veteran Veteran

    Messages:
    55
    Likes Received:
    8
    Location:
    Void
    First Language:
    English
    Your the best I'm totally error free now thanks for your help. My game runs super smooth now no more fps slowdown or rgss3 crashes. Thanks again you saved me from a lot of headaches. 
     
    #36
  17. Mike

    Mike Veteran Veteran

    Messages:
    316
    Likes Received:
    35
    First Language:
    English
    Seems like it won't show anything in console if the stack-level is too deep?

    [​IMG]
    Though at least it gave me a clue where I should start looking at. : x

    Edit: Fixed, seems like no report will be given if the said method call(s) is inside the 'hidden class'.

    Edit:

    The following line would give the dispose window error

    class Window alias asd initialize def initialize(*a) cursor_rect += 0 asd(*a) endendThe following line would give the RGSS3 AppCrash

    Code:
    class Window  alias asd initialize  def initialize(*a)    asd(*a)    cursor_rect.x += 0  endend
     
    Last edited by a moderator: Feb 3, 2014
    #37
  18. Gurokun

    Gurokun Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    you've saved me!!!
     
    #38
  19. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,384
    Likes Received:
    4,954
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I just want to say "Thank you VERY MUCH" to this script. My battle system script now works. If it's not because this awesome debugger, I might have not noticed where are my mistakes
     
    #39
  20. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    You are welcome. It is nice to see this being used to debug by scripters to fix the issue before it becomes a real problem.
     
    #40

Share This Page