Forum

Nvidia 191.xx drivers bugfix.

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Nvidia 191.xx drivers bugfix.

Postby Irritant » Wed Oct 14, 2009 4:35 am

Nice job Nvidia. 191.xx drivers blow up alot of Quake engines.

The fix is to replace vsprintf with _vsnprintf. Ugg.

Kirk Barnes gets credit for finding this...
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Postby Spike » Wed Oct 14, 2009 9:20 am

If you're sprinting the gl extensions string into a buffer somewhere without checking the length of it, then its your own damn fault. Or more likely Id's...
Just copying any unbounded string of unknown length to a fixed-length string is always bad.
By using vsnprintf instead, you're truncating the string. There might have been something important in there.

Q1 engines crashed because of overlong extension strings years and years ago.
It surprises me that there are engines out there that are still susceptible.
Unless you're talking about something else...

If I remember correctly, NVidia provide some registry keys to choose which extensions to hide from apps. It just stops claiming it supports it. Feel free to cripple your drivers so that quake runs again without being fixed.

Note that GL_EXTENSIONS is depricated in opengl v3. There's a different mechanism that queries extensions by number instead. In part so that developers stop blindly copying extension strings into other buffers then strstring for the extension names they want... as that is also bad practice.
Strict opengl3 is annoying.

Sorry... But nvidia are not to blame.
Chances are they detect glquake and trim off some of the extensions that glquake never used... And no longer ever can. At least this is what will happen if you complain to them.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby mh » Wed Oct 14, 2009 9:30 am

You shouldn't be relying on querying the extension string anyway; we all know of drivers that report support for a particular extension but that don't actually support it properly, if at all. Best approach is to test for entry points (if applicable) and set up a flag indicating if a feature is present or not based on that. It's also worthwhile doing an API call (or calls) and checking the result of glGetError () as part of your setup.

Bottom line with OpenGL is that drivers cannot be relied on to behave themselves properly, so you need to take on responsibility for ensuring that stuff works yourself.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Irritant » Wed Oct 14, 2009 2:38 pm

Yes, to clarify, the errors were occuring in the extension checking of quake 1 and quake 2 engines. Q3 fixed the problem using vsnprintf.
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Re: Nvidia 191.xx drivers bugfix.

Postby Tomaz » Wed Oct 14, 2009 2:46 pm

Irritant wrote:Nice job Nvidia. 191.xx drivers blow up alot of Quake engines.

The fix is to replace vsprintf with _vsnprintf. Ugg.

Kirk Barnes gets credit for finding this...


That "bug" happened years ago. It's been fixed in just about any engine that has been run on anything newer than a GeForce 2 card.

A similar bug happens with the larger monitors of today, one of the arrays in gl_vidnt.c isn't big enough to hold all the resolutions the newer monitor/3d cards support.
Tomaz
 
Posts: 67
Joined: Fri Nov 05, 2004 8:21 pm

Postby mh » Wed Oct 14, 2009 4:03 pm

Ain't that big a deal as you should always be using _vsnprintf anyway...
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Irritant » Wed Oct 14, 2009 4:59 pm

This was something in the id code, nothing that other people put in.

Alot of engines didn't change this, contrary to what Tomaz posted.

This is really the first I'd heard of it. I've never experienced crashes because of this until the 191.xx drivers came out.
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Postby revelator » Mon Nov 02, 2009 9:54 am

another one to add

Code: Select all
void Sys_PumpMessages (void) {
    MSG      msg;
   while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
      if (!GetMessage(&msg, NULL, 0, 0)) {
         Sys_Quit();
      }
      sys_msgTime = msg.time;
        TranslateMessage(&msg);
        DispatchMessage(&msg);
   }

   // Grab frame time
   sys_frameTime = timeGetTime();   // FIXME: should this be at start?
}


q2evolved crashes in this on windows 7 with cant read the expression. i applied the fix but still crashes here so not sure where the culprit may be.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby mh » Mon Nov 02, 2009 12:46 pm

Just put the 191 drivers on my main machine. It seems that the cause of this is not actually the overlong extension string, but the fact that the "trim extension string" option in the Nvidia control panel defaults to false, and the list of applications which have special settings is substantially reduced (none of the Quakes are there).
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest