Garry's Mod Logo
schedule 14 November 2012
Devblog

Garry's Mod - Update 151

Oh man, what a couple of days. So as we all know the update on Monday was causing a crash on startup. People found that if they ran the game again - while the ‘it has crashed’ dialog was popped up it’d run fine. Which is very, very weird.

So I did a clean build, I wiped the build server, rebuilt all of the binaries. I packaged it and started a local content server.. and it worked! So the problem was that the binaries must have been using stale libs or something. So I sent 150 to Valve.

Then when it went live. And the crash remained. I could have cried.

The crash logs were always the same. It was crashing when trying to access a class that was in client.dll. But the client.dll is all proper, there’s no way it could be an uninitialized variable. So I went though the 2,500 code merge, line by line, to see if there was anything that could have caused that.

I found some code in the filesystem library - which was added for linux to handle the new _srv.so translation stuff. I’m not going to pretend I totally understand why, but it was unloading the library. So my theory is that this code was unloading client.dll. Leaving a hanging pointer.

So I fixed that up and it worked locally. But so did the last patch. Luckily I’d previously added a debug command that isolated that piece of code, so it didn’t run. I asked a few people on twitter to try the command line - and it fixed the crash for them. So I was reasonably happy that it would fix the crash.

So I sent the update to Valve and.. thank god.. it did

Some people are reporting a FPS loss after this update. I would encourage them to think about what they tried to make it stop crashing (did you add any command lines?) - and try to undo those. Play with your display settings because they might have changed.

TLDR gmod don’t crash no more