View Single Post
Old 01-08-03, 11:10 PM   #1
midekra
Registered User
 
Join Date: Jan 2003
Posts: 7
Default nVidia libraries crash some OpenGL apps but not others


Problem: X starts (no problems whatsoever here), but *some* OpenGL applications crash on startup.

Hardware involved:
GeForce4 MX440
MSI KT3 Ultra2 motherboard, uses Via KT333 chipset

Relevant software versions:
% uname -smr
FreeBSD 4.7-20021204-STABLE i386

XFree86-libraries-4.2.1_1
XFree86-Server-4.2.1_3
XFree86-clients-4.2.1_1
Mesa-3.4.2_2
sdl-1.2.4_1

NVIDIA_FreeBSD-1.0-3203

The following games work using Mesa but crash using nVidia's libraries:
foobillard-1.8
race-0.5
gl-117-0.7 (crashes nastily)

However the following game works fine using either
xracer-0.94

And so do glxgears and testgl (one of the demos from SDL)

I installed XFree86-libraries first, then Mesa and finally nVidia's driver. The results of this setup follows:

% ls -l /usr/X11R6/lib/*GL*
-rw-r--r-- 1 root wheel 625336 Oct 5 09:55 /usr/X11R6/lib/XXX-libGL.a.%%.XFree86-libraries-4.2.1_1
-rw-r--r-- 1 root wheel 552148 Nov 22 07:28 /usr/X11R6/lib/XXX-libGL.a.%%.XFree86-libraries-4.2.1_3
-rwxr-xr-x 1 root wheel 467028 Oct 5 09:55 /usr/X11R6/lib/XXX-libGL.so.1.%%.XFree86-libraries-4.2.1_1*
-rwxr-xr-x 1 root wheel 464665 Nov 22 07:28 /usr/X11R6/lib/XXX-libGL.so.1.%%.XFree86-libraries-4.2.1_3*
-rwxr-xr-x 1 root wheel 1900975 Sep 13 2001 /usr/X11R6/lib/XXX-libGL.so.14.%%.Mesa-3.4.2_1*
lrwxr-xr-x 1 root wheel 10 Jan 8 18:55 /usr/X11R6/lib/libGL.so@ -> libGL.so.1
-r--r--r-- 1 root wheel 285980 Jan 8 18:55 /usr/X11R6/lib/libGL.so.1
-rw-r--r-- 1 root wheel 838422 Oct 5 09:55 /usr/X11R6/lib/libGLU.a
lrwxrwxrwx 1 root wheel 11 Jan 8 17:50 /usr/X11R6/lib/libGLU.so@ -> libGLU.so.1
-rwxr-xr-x 1 root wheel 516506 Oct 5 09:55 /usr/X11R6/lib/libGLU.so.1*
lrwxr-xr-x 1 root wheel 14 Jan 8 18:55 /usr/X11R6/lib/libGLcore.so@ -> libGLcore.so.1
-r--r--r-- 1 root wheel 3521968 Jan 8 18:55 /usr/X11R6/lib/libGLcore.so.1
-rw-r--r-- 1 root wheel 26048 Oct 5 09:55 /usr/X11R6/lib/libGLw.a
lrwxr-xr-x 1 root wheel 23 Jan 8 17:51 /usr/X11R6/lib/libMesaGL.so@ -> /usr/X11R6/lib/libGL.so
lrwxr-xr-x 1 root wheel 24 Jan 8 17:51 /usr/X11R6/lib/libMesaGLU.so@ -> /usr/X11R6/lib/libGLU.so

Are these the nVidia-supplied libraries?

% md5 /usr/X11R6/lib/libGL.so.1 /usr/X11R6/lib/libGLcore.so.1
MD5 (/usr/X11R6/lib/libGL.so.1) = f83dd20d730614e93b64f508961c04fb
MD5 (/usr/X11R6/lib/libGLcore.so.1) = a9876ffd5c02d0b02bb5e754fcaa0cc4

% md5 /usr/src/NVIDIA_FreeBSD-1.0-3203/obj/libGL.so.1 /usr/src/NVIDIA_FreeBSD-1.0-3203/obj/libGLcore.so.1
MD5 (/usr/src/NVIDIA_FreeBSD-1.0-3203/obj/libGL.so.1) = f83dd20d730614e93b64f508961c04fb
MD5 (/usr/src/NVIDIA_FreeBSD-1.0-3203/obj/libGLcore.so.1) = a9876ffd5c02d0b02bb5e754fcaa0cc4

Yes, they are.

Now let's try to run an application.

Using race, which works perfectly using Mesa, as an example:

% ldd /usr/local/bin/race
/usr/local/bin/race:
libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x2806b000)
libGLU.so.1 => /usr/X11R6/lib/libGLU.so.1 (0x280b4000)
libSDL_image.so.10 => /usr/local/lib/libSDL_image.so.10 (0x28122000)
libSDL_mixer.so.2 => /usr/local/lib/libSDL_mixer.so.2 (0x2813b000)
libm.so.2 => /usr/lib/libm.so.2 (0x2817e000)
libSDL-1.1.so.4 => /usr/local/lib/libSDL-1.1.so.4 (0x28199000)
libc_r.so.4 => /usr/lib/libc_r.so.4 (0x281ec000)
libGLcore.so.1 => /usr/X11R6/lib/libGLcore.so.1 (0x282a1000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x28623000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28631000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x286ed000)
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x28732000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x28750000)
libz.so.2 => /usr/lib/libz.so.2 (0x28773000)
libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x28780000)
libvorbisfile.so.3 => /usr/local/lib/libvorbisfile.so.3 (0x287c3000)
libvorbis.so.2 => /usr/local/lib/libvorbis.so.2 (0x287c9000)
libogg.so.4 => /usr/local/lib/libogg.so.4 (0x287e9000)
libsmpeg.so.1 => /usr/local/lib/libsmpeg.so.1 (0x287ed000)
libesd.so.2 => /usr/local/lib/libesd.so.2 (0x28845000)
libaudiofile.so.0 => /usr/local/lib/libaudiofile.so.0 (0x2884d000)
libgnugetopt.so.1 => /usr/local/lib/libgnugetopt.so.1 (0x28870000)
libvga.so.1 => /usr/local/lib/libvga.so.1 (0x28873000)
libaa.so.1 => /usr/local/lib/libaa.so.1 (0x288c4000)
libusbhid.so.0 => /usr/lib/libusbhid.so.0 (0x288da000)
libXThrStub.so.6 => /usr/X11R6/lib/libXThrStub.so.6 (0x288de000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x288e0000)

Which shows that it is trying to use nVidia's libraries, isn't it?

However,

% /usr/local/bin/race
Race Game version 0.5
Copyleft foobar and judeo (See COPYING for info)
Loaded: Config File (7 Variables)
Loaded: SDL
Loaded: Audio
Loaded: OpenGL
Loaded: Fonts
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
X connection to :0.0 broken (explicit kill or server shutdown).
zsh: segmentation fault race

Something similar occurs with foobillard:

% ldd /usr/local/bin/foobillard
/usr/local/bin/foobillard:
libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x2809e000)
libSDL-1.1.so.4 => /usr/local/lib/libSDL-1.1.so.4 (0x280e8000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x2813b000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x28144000)
libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x2815a000)
libGLU.so.1 => /usr/X11R6/lib/libGLU.so.1 (0x281a3000)
libXaw.so.7 => /usr/X11R6/lib/libXaw.so.7 (0x28211000)
libm.so.2 => /usr/lib/libm.so.2 (0x28264000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x2827f000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x28287000)
libz.so.2 => /usr/lib/libz.so.2 (0x282aa000)
libc_r.so.4 => /usr/lib/libc_r.so.4 (0x282b7000)
libgnugetopt.so.1 => /usr/local/lib/libgnugetopt.so.1 (0x2836c000)
libesd.so.2 => /usr/local/lib/libesd.so.2 (0x2836f000)
libaudiofile.so.0 => /usr/local/lib/libaudiofile.so.0 (0x28377000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x2839a000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x28456000)
libvga.so.1 => /usr/local/lib/libvga.so.1 (0x28464000)
libaa.so.1 => /usr/local/lib/libaa.so.1 (0x284b5000)
libusbhid.so.0 => /usr/lib/libusbhid.so.0 (0x284cb000)
libGLcore.so.1 => /usr/X11R6/lib/libGLcore.so.1 (0x284cf000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x28851000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x28896000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x288ab000)
libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x288f5000)
libXThrStub.so.6 => /usr/X11R6/lib/libXThrStub.so.6 (0x28903000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x28905000)

% /usr/local/bin/foobillard
... some irrelevant output removed ...
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
zsh: segmentation fault foobillard

But, interestingly, xracer works fine. Is it using the same libraries?

% ldd /usr/local/bin/xracer
/usr/local/bin/xracer:
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x2807e000)
libglut.so.3 => /usr/X11R6/lib/libglut.so.3 (0x2809c000)
libGLU.so.1 => /usr/X11R6/lib/libGLU.so.1 (0x280ce000)
libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x2813c000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x28185000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x2818e000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x281a4000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x28260000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x28268000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x28276000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x2828b000)
libm.so.2 => /usr/lib/libm.so.2 (0x282d5000)
libc_r.so.4 => /usr/lib/libc_r.so.4 (0x282f0000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x283a5000)
libGLcore.so.1 => /usr/X11R6/lib/libGLcore.so.1 (0x283ea000)
libXThrStub.so.6 => /usr/X11R6/lib/libXThrStub.so.6 (0x2876c000)

Yes, it is.

As a final attempt, let's run testgl

% /usr/local/share/examples/SDL11/testgl
Screen BPP: 32

Vendor : NVIDIA Corporation
Renderer : GeForce4 MX 440/AGP/3DNOW!
Version : 1.3.1 NVIDIA 32.03
Extensions : GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_S3_s3tc GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shared_texture_palette GL_EXT_stencil_wrap GL_EXT_texture_compression_s3tc GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_cube_map GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_vertex_weighting GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_evaluators GL_NV_fence GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_register_combiners GL_NV_texgen_emboss GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SGIS_texture_lod

SDL_GL_RED_SIZE: requested 5, got 8
SDL_GL_GREEN_SIZE: requested 5, got 8
SDL_GL_BLUE_SIZE: requested 5, got 8
SDL_GL_DEPTH_SIZE: requested 16, got 24
SDL_GL_DOUBLEBUFFER: requested 1, got 1
app lost mouse focus
app gained mouse focus
app lost mouse focus
841.45 FPS

And it runs fine. Which libraries is it using?

% ldd /usr/local/share/examples/SDL11/testgl
/usr/local/share/examples/SDL11/testgl:
libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x28068000)
libm.so.2 => /usr/lib/libm.so.2 (0x280b1000)
libSDL-1.1.so.4 => /usr/local/lib/libSDL-1.1.so.4 (0x280cc000)
libc_r.so.4 => /usr/lib/libc_r.so.4 (0x2811f000)
libGLcore.so.1 => /usr/X11R6/lib/libGLcore.so.1 (0x281d4000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x28556000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28564000)
libesd.so.2 => /usr/local/lib/libesd.so.2 (0x28620000)
libaudiofile.so.0 => /usr/local/lib/libaudiofile.so.0 (0x28628000)
libgnugetopt.so.1 => /usr/local/lib/libgnugetopt.so.1 (0x2864b000)
libvga.so.1 => /usr/local/lib/libvga.so.1 (0x2864e000)
libaa.so.1 => /usr/local/lib/libaa.so.1 (0x2869f000)
libusbhid.so.0 => /usr/lib/libusbhid.so.0 (0x286b5000)
libXThrStub.so.6 => /usr/X11R6/lib/libXThrStub.so.6 (0x286b9000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x286bb000)

So, what's going on here?

midekra is offline   Reply With Quote