Thursday 25 September 2014

Monster Crash Freeze

Every now again, once every few years, you encounter a bug which dwarfs the daily bug, reassuring the typical plodding coder that he still has a lot to learn. The bug in this case is one which flickers the whole screen, and then after around 5 seconds freezes everything, apps, processes, mouse, task manager, everything. The only escape is a hard reset and complete reboot of Windows. Now this type of super crash was quite common before processors got to Ghz speeds, when you only had one core and a hacky way to do threading.  So much in fact that when this new monster bug occurred, it was like a blast from the past.  Not a happy journey into nostalgia though as it is precisely in my way to creating nice looking scenes and fast games.

Actually stayed up until 2AM last night battling with it, to no avail. All my tricks to hunt it down resulted merely in the insight that it is definitely rogue memory writing that is to blame.  The corruption strikes in the object sort list, in the object data themselves and in the vertex buffer manager, so there is no specific target and the damage hits in a different place each execution. Even data based breakpoints failed as the area being monitored would be corrupt the first time but not the second.

Today I had the idea that I should amend the light mapper to use a single main thread and to create smaller light mapping batches with a smaller test level so I can concentrate the bug effect and have a chance of the program using the same address space on repeated runs.  I am now in the middle of this process and hopefully I can then use my data breakpoint trick to find the origin of the rogue who is randomly writing bytes into someone else's memory.  I've also been asked for some top notch light mapping screenshots so it's critical I get this fixed, new scenes designed and shots made before the newsletter comes out.  Wish me luck!

5 comments:

  1. good luck lee m8, happy hunting :)

    ReplyDelete
  2. i know this sounds a bit random but is there a chance of adding a saturate \ de saturate colour slider ?, so you can set all the lights and things then when the mix is done you can then tone down the colour, this would be a nice addition and i think will help give a more interesting scene like tim burton does monochrome etc and it is not just about turn all to zero like ambience surface, as this does not affect the lighting it is just an easy option and i think would speed up the process, and would be simpler for others, this is just a thrown out there query, hope you find that bug and good luck

    ReplyDelete
  3. Wow, best of luck with that one. Part of me can't wait to hear what is going on and how you fixed it. Another part is looking forward to seeing the end results.

    ReplyDelete
  4. Good luck Lee with this monster bug

    ReplyDelete
  5. Good luck, mate. If anyone can hunt this thing down it's you. Remember you are a blackbelt - unlike Turok. x

    ReplyDelete