Bug 5823 - Crash w/Segmentation Fault
Status: RESOLVED FIXED
Alias: None
Product: Dungeon Defenders
Classification: Unclassified
Component: everything
Version: unspecified
Hardware: PC Linux
: P3 critical
Assignee: Ryan C. Gordon
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2012-12-20 13:23 EST by Gink
Modified: 2013-03-06 03:57:44 EST
18 users (show)

See Also:



Description Gink 2012-12-20 13:23:35 EST
On launch, splash screen flashes then app crashes with Segmentation Fault. Ubuntu 12.04 64-bit
Comment 1 bugmenot 2012-12-20 16:42:27 EST
Same problem here under Arch 64bits on a thinkpad x220 laptop, 8GB of RAM and intel hd 3000.

segmentation fault (core dumped)  UDKGame/Binaries/DungeonDefenders-x86
Comment 2 Peter Palfrader 2012-12-20 17:06:05 EST
Same on Debian amd64 squeeze and wheezy (debian's fglrx-driver (1:12-6+point-1) - based on AMD internal version 8.982.13; and whatever intel is in a thinkpad x220 respectively).

Start it, splash screen, segfault.

Here's the backtrace on the squeeze/amd:

(gdb) bt
#0  0x09a21c8e in TOpenGLShader<(ERHIResourceTypes)8, 35632u>::Compile() ()
#1  0x09a039c7 in FOpenGLDynamicRHI::CreatePixelShader(TArray<unsigned char, FDefaultAllocator> const&) ()
#2  0x08e9bd76 in FShader::InitRHI() ()
#3  0x099fc778 in FOpenGLDynamicRHI::Init() ()
#4  0x09a2dc4e in FOpenGLViewport::FOpenGLViewport(FOpenGLDynamicRHI*, void*, unsigned int, unsigned int, unsigned int) ()
#5  0x09a2c46f in FOpenGLDynamicRHI::CreateViewport(void*, unsigned int, unsigned int, unsigned int) ()
#6  0x090c8b5d in FViewport::UpdateViewportRHI(unsigned int, unsigned int, unsigned int, unsigned int) ()
#7  0x09af9683 in FMacViewport::Resize(unsigned int, unsigned int, unsigned int, int, int) ()
#8  0x09af91d1 in FMacViewport::FMacViewport(UMacClient*, FViewportClient*, wchar_t const*, unsigned int, unsigned int, unsigned int, int, int) ()
#9  0x09af222f in UMacClient::CreateViewportFrame(FViewportClient*, wchar_t const*, unsigned int, unsigned int, unsigned int) ()
#10 0x088c0e5d in FEngineLoop::Init() ()
#11 0x088b80cd in GuardedMain(wchar_t const*, void*, void*, int) ()
#12 0x09af5e32 in appMacCallGuardedMain() ()
#13 0x09aff23b in main ()
Comment 3 Ckohnke 2012-12-20 20:57:38 EST
Same on Arch x64, with 4 GB RAM and Intel drivers. 
Here's a backtrace. Appears to be the same as above.

Program received signal SIGSEGV, Segmentation fault.
0x09a21c8e in TOpenGLShader<(ERHIResourceTypes)8, 35632u>::Compile() ()
(gdb) bt
#0  0x09a21c8e in TOpenGLShader<(ERHIResourceTypes)8, 35632u>::Compile() ()
#1  0x09a039c7 in FOpenGLDynamicRHI::CreatePixelShader(TArray<unsigned char, FDefaultAllocator> const&) ()
#2  0x08e9bd76 in FShader::InitRHI() ()
#3  0x099fc778 in FOpenGLDynamicRHI::Init() ()
#4  0x09a2dc4e in FOpenGLViewport::FOpenGLViewport(FOpenGLDynamicRHI*, void*, unsigned int, unsigned int, unsigned int) ()
#5  0x09a2c46f in FOpenGLDynamicRHI::CreateViewport(void*, unsigned int, unsigned int, unsigned int) ()
#6  0x090c8b5d in FViewport::UpdateViewportRHI(unsigned int, unsigned int, unsigned int, unsigned int) ()
#7  0x09af9683 in FMacViewport::Resize(unsigned int, unsigned int, unsigned int, int, int) ()
#8  0x09af91d1 in FMacViewport::FMacViewport(UMacClient*, FViewportClient*, wchar_t const*, unsigned int, unsigned int, unsigned int, int, int) ()
#9  0x09af222f in UMacClient::CreateViewportFrame(FViewportClient*, wchar_t const*, unsigned int, unsigned int, unsigned int) ()
#10 0x088c0e5d in FEngineLoop::Init() ()
#11 0x088b80cd in GuardedMain(wchar_t const*, void*, void*, int) ()
#12 0x09af5e32 in appMacCallGuardedMain() ()
#13 0x09aff23b in main ()


Also, segfault error is not displayed in the terminal when running as sudo, but the splash screen still displays then promptly disappears.
Comment 4 David Gow 2012-12-20 21:53:16 EST
This is caused by "GL_EXT_bindable_uniform" being unsupported.

The shader in question (the first fragment program to be loaded, none of the vertex programs seem to require it) begins with:
#version 120
#extension GL_EXT_bindable_uniform : require
which pretty much seals the deal. glxinfo, of course, does not show GL_EXT_bindable uniform as being supported, and MESA_GLSL=dump shows:
GLSL shader 1 failed to compile.
GLSL shader 1 info log:
0:2(12): error: extension `GL_EXT_bindable_uniform' unsupported in fragment shader

Mesa does support GL_ARB_uniform_buffer_object, though, which implements a superset of EXT_bindable_uniform functionality (though I understand Mac OS X has had some problems with it). Perhaps this could be used instead?

-- David
Comment 5 icculus 2012-12-21 12:48:40 EST
I have GL_EXT_bindable_uniform marked as supported by glxinfo, but still get a crash with the same backtrace.

How do I get the glsl debug output?
export MESA_GLSL=dump
didnt help

Sysinfo:
Arch Linux 64-bit
fglrx version: 12.9-0.1
Comment 6 bugmenot 2012-12-21 15:56:18 EST
(In reply to comment #5)
> How do I get the glsl debug output?

Here's the command as offered on DungeonDefenders forums linux FAQ [1]:
MESA_GLSL=dump ./DungeonDefenders


[1]:http://forums.trendyent.com/showthread.php?88074-Linux-Version-FAQ&p=747312&viewfull=1#post747312
Comment 7 Martin Chase 2012-12-22 05:43:09 EST
Same error and stack on Ubuntu 12.10, with xorg-edgers ppa, running on Intel HD Graphics 4000. GL_EXT_bindable_uniform is not listed in my glxinfo.
Comment 8 Jógvan Olsen 2012-12-22 11:49:16 EST
This is also happening to me. I run Linux Mint 14 64bit
I get this error when trying to launch it

jeggy@jeggy-mint /opt/dungeondefenders/UDKGame/Binaries $
./DungeonDefenders-x86
Segmentation fault (core dumped)

I tried running this command "MESA_GLSL=dump ./DungeonDefenders-x86" and i got
this long here, but still didn't work
http://paste.ubuntu.com/1457339/
Comment 9 Martin Chase 2012-12-22 14:50:18 EST
As an experiment, I tried MESA_GL_VERSION_OVERRIDE=3.0 and MESA_GL_VERSION_OVERRIDE=2.1, but to no avail; the game isn't checking for the GL version before it tries to use GL_EXT_bindable_uniform.
Comment 10 Jan-Marek Glogowski 2012-12-25 00:24:45 EST
I'm on Ubuntu 12.10 (quantal).

I found: http://www.opengl.org/discussion_boards/showthread.php/166810-Any-luck-using-ATI-s-bindable-uniforms?p=1178268&viewfull=1#post1178268

So I "simply" patched the shaders for ATI with sed:

$ cd DungeonDefenders/UDKGame/CookedMacOSX
$ cp RefShaderCache-OpenGL.upk RefShaderCache-OpenGL.upk_
$ cp GlobalShaderCache-OpenGL.bin GlobalShaderCache-OpenGL.bin_
$ sed -i -e 's/GL_EXT_bindable_uniform : require/GL_EXT_bindable_uniform : enable /g' GlobalShaderCache-OpenGL.bin RefShaderCache-OpenGL.upk

I have an AMD / ATI RV710 Mobility Radeon HD 4500, which seems to be to slow to actually play the game. So I can't really check, if it is working, but I don't get a SEGFAULT and after a few ESC I see the title screen.
Comment 11 ronny 2012-12-25 09:16:15 EST
Can't confirm, if i do this sed-"patch", the intro starts, but segfaults few sec later at my machine.
Comment 12 Kenneth Graunke 2012-12-25 23:27:45 EST
Ryan,

It looks like most of Dungeon Defenders' shaders contain:

    #extension GL_EXT_bindable_uniform : require

but also /*ndabl*/ everywhere...i.e. it looks like it *used* to use the extension, but doesn't anymore.  If that's true, would it be possible to remove the #extension lines?  We'd like to avoid implementing EXT_bindable_uniform unless we have to (especially since we already support UBOs, which are more forward looking).

It looks like on Mesa/i965, we're hitting some other unrelated crashes, so I'll look into fixing those...

Thanks!
Comment 13 Alexander Minges 2012-12-26 17:31:43 EST
(In reply to comment #10)
> I'm on Ubuntu 12.10 (quantal).
> 
> I found:
> http://www.opengl.org/discussion_boards/showthread.php/166810-Any-luck-using-ATI-s-bindable-uniforms?p=1178268&viewfull=1#post1178268
> 
> So I "simply" patched the shaders for ATI with sed:
> 
> $ cd DungeonDefenders/UDKGame/CookedMacOSX
> $ cp RefShaderCache-OpenGL.upk RefShaderCache-OpenGL.upk_
> $ cp GlobalShaderCache-OpenGL.bin GlobalShaderCache-OpenGL.bin_
> $ sed -i -e 's/GL_EXT_bindable_uniform : require/GL_EXT_bindable_uniform :
> enable /g' GlobalShaderCache-OpenGL.bin RefShaderCache-OpenGL.upk
> 
> I have an AMD / ATI RV710 Mobility Radeon HD 4500, which seems to be to slow to
> actually play the game. So I can't really check, if it is working, but I don't
> get a SEGFAULT and after a few ESC I see the title screen.

This works for me (Lenovo X220 with Intel HD 3000). I can start and play a game in windowed mode. Changing to fullscreen crashes the game.
Comment 14 Ckohnke 2012-12-27 01:49:34 EST
(In reply to comment #13)
> (In reply to comment #10)
> > I'm on Ubuntu 12.10 (quantal).
> > 
> > I found:
> > http://www.opengl.org/discussion_boards/showthread.php/166810-Any-luck-using-ATI-s-bindable-uniforms?p=1178268&viewfull=1#post1178268
> > 
> > So I "simply" patched the shaders for ATI with sed:
> > 
> > $ cd DungeonDefenders/UDKGame/CookedMacOSX
> > $ cp RefShaderCache-OpenGL.upk RefShaderCache-OpenGL.upk_
> > $ cp GlobalShaderCache-OpenGL.bin GlobalShaderCache-OpenGL.bin_
> > $ sed -i -e 's/GL_EXT_bindable_uniform : require/GL_EXT_bindable_uniform :
> > enable /g' GlobalShaderCache-OpenGL.bin RefShaderCache-OpenGL.upk
> > 
> > I have an AMD / ATI RV710 Mobility Radeon HD 4500, which seems to be to slow to
> > actually play the game. So I can't really check, if it is working, but I don't
> > get a SEGFAULT and after a few ESC I see the title screen.
> 
> This works for me (Lenovo X220 with Intel HD 3000). I can start and play a game
> in windowed mode. Changing to fullscreen crashes the game.

On integrated Intel graphics card and the "patch" I'm able to start the game, but the frame rate is unplayable after the intro movies. Also the "Press Any Key to continue..." does work in the intro movies (or works sporadically).
Comment 15 edbackell 2013-01-11 15:31:39 EST
Using Ubuntu 12.04 32bit, XFCE, nVidia GeForce 5200 card, game will not start - splash screen displayed, then segmentation fault (core dumped).
Comment 16 Ryan C. Gordon 2013-03-02 21:37:40 EST
Just following up here...

> It looks like most of Dungeon Defenders' shaders contain:
> 
>     #extension GL_EXT_bindable_uniform : require
> 
> but also /*ndabl*/ everywhere...i.e. it looks like it *used* to use the
> extension, but doesn't anymore.

Turns out to be true:

#if !OPENGL_USE_BINDABLE_UNIFORMS
	while (ANSICHAR *Bindable = strstr(CodePtr, "bindable uniform"))
	{
		Bindable[0] = '/';
		Bindable[1] = '*';
		Bindable[7] = '*';
		Bindable[8] = '/';
	}
#endif

...this code is used on Mac OS X, too, even though Apple supports the extension.

I'll chop out the require line for the next build (coming soon!).

--ryan.
Comment 17 Kenneth Graunke 2013-03-03 01:26:58 EST
(In reply to comment #16)
> I'll chop out the require line for the next build (coming soon!).
> 
> --ryan.

Awesome, thanks Ryan!
Comment 18 Ryan C. Gordon 2013-03-06 02:14:29 EST
Marking several bugs as FIXED. There's a new build for the new Humble Bundle that resolves this issue. Log in to your Humble Bundle account and redownload the game to get the latest version.

(I'll put up a set of files that represent the difference between the two builds; they added more DLC since the first bundle, so you're going to have to download a few hundred megabytes, but it's better than a 5+ gigabytes. I'll try to do that tomorrow.)

--ryan.