Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 326837 - games-fps/rtcw-1.41 single player unplayable
Summary: games-fps/rtcw-1.41 single player unplayable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-04 08:33 UTC by Jared B.
Modified: 2010-08-17 07:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patched wolfsp.x86 binary (wolfsp.x86,1.24 MB, text/plain)
2010-07-04 08:35 UTC, Jared B.
Details
patch to add __GL_ExtensionStringVersion variable (rtcw-1.41b.patch,461 bytes, text/plain)
2010-07-05 12:18 UTC, Jared B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared B. 2010-07-04 08:33:30 UTC
The current (final) version of Return to Castle Wolfenstein, 1.41, is unplayable with modern hardware/drivers due to a bug in the graphics initialization code.  After displaying the available GL_EXTENSIONS on the console (when starting the game), rtcw immediately quits with "Received signal 11, exiting...".

A good explanation of the problem is available here: http://forums.debian.net/viewtopic.php?f=6&t=48415

The short version is that the GL_EXTENSIONS output string is hardcoded to 4 KB, and if the hardware/driver capabilities list exceeds that 4 KB limit, the binary will crash.  Not sure why, but this only affects the single player binary (wolfsp.x86).  The multiplayer binary still works just fine.

The above forum discussion also includes a workaround, although it involves hex-editing the wolfsp.x86 binary.  It basically disabled the GL_EXTENSIONS output on the console; simple concept (if somewhat of a hack), but unfortunately not so simple to actually do for most users.  I was able to do it myself and can confirm that it does indeed work, and wanted to create this bug report to let others know about the problem and possible solution.  Unfortunately, this so far appears to be the only solution available.

I'm attaching my patched wolfsp.x86 binary to this bug report, in case anyone else runs into this problem.  It'd be nice if we could somehow work this into the ebuild, but I'm not sure how that could be done given the whole hex edit thing.  Ideas welcome.

Reproducible: Always

Steps to Reproduce:
Comment 1 Jared B. 2010-07-04 08:35:36 UTC
Created attachment 237417 [details]
patched wolfsp.x86 binary
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2010-07-04 09:21:29 UTC
No need to CC yourself as reporter of a bug...
Comment 3 Jared B. 2010-07-05 12:18:29 UTC
Found a better solution:
ftp://download.nvidia.com/XFree86/Linux-x86/195.22/README/knownissues.html#extension_string_size

Apparently nvidia has received reports about this for other games as well and they've added support for an environmental variable (__GL_ExtensionStringVersion) to control how the GL_EXTENSIONS information is returned.  It essentially instructs the driver to lie about it's capabilities and report as if it were an older version of the driver.

I'm attaching a diff to the current portage ebuild that contains the fix.  It simply adds the environmental variable in the game bin wrapper (rtcwsp).

Presumably this only applies to nvidia users, but:
1. I can't find reports of non-nvidia users being affected
2. Non-nvidia drivers should completely ignore the variable

It'd be nice to limit this to just nvidia binary driver users, but I couldn't find a good way to do that in an ebuild.  Suggestions welcome.

I'm also dropping the severity of this bug down to normal.  critical fits the bugzilla description, which is why I chose it, but given that it's a crash in an almost 9 year old game, in the grand scheme of things I don't think this quite counts as a critical for Gentoo.
Comment 4 Jared B. 2010-07-05 12:18:56 UTC
Created attachment 237569 [details]
patch to add __GL_ExtensionStringVersion variable
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2010-08-17 07:13:08 UTC
in portage.  thanks for the bug report and sed patch.