Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix crash with Nvidia 331.38 drivers on Linux #314

Closed
wants to merge 1 commit into from
Closed

Fix crash with Nvidia 331.38 drivers on Linux #314

wants to merge 1 commit into from

Conversation

tronical
Copy link

@tronical tronical commented Jun 8, 2014

glDeleteFramebuffers appears to crash when called with zero FBOs to
delete.

glDeleteFramebuffers appears to crash when called with zero FBOs to
delete.
@springmeyer
Copy link
Contributor

Thanks for this report. Can you share what linux version you saw this on and the backtrace? I'd like to delve deeper to see if I can replicate.

@tronical
Copy link
Author

Sure. Here are some more details:

From glxinfo: OpenGL core profile version string: 3.3.0 NVIDIA 331.38
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
This is on x86-64.

With a debug build of mapbox-gl I get the following debug output and back trace:
Starting program: /home/simon/src/mapbox-gl-native/build/Debug/mapbox-gl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff1fa6700 (LWP 15008)]
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.92616ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.6748ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.72836ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.73084ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.65924ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.61612ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 2.00356ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.86144ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.6242ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.5998ms
Shader compile log:
Shader compile log:
Program link log:
Program validate log:
shader compilation: 0.6336ms
painter setup: 13.3732ms
[New Thread 0x7ffff158d700 (LWP 15009)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1fa6700 (LWP 15008)]
0x00007ffff3d59f9c in ?? () from /usr/lib/nvidia-331-updates/libnvidia-glcore.so.331.38
(gdb) bt
#0 0x00007ffff3d59f9c in ?? () from /usr/lib/nvidia-331-updates/libnvidia-glcore.so.331.38
#1 0x00007ffff3d1371e in ?? () from /usr/lib/nvidia-331-updates/libnvidia-glcore.so.331.38
#2 0x0000000000483172 in llmr::Painter::clearFramebuffers (this=0x7fffffffda08) at ../../src/renderer/painter_framebuffers.cpp:25
#3 0x0000000000431e73 in llmr::Map::prepare (this=0x7fffffffd880) at ../../src/map/map.cpp:460
#4 0x000000000043004b in llmr::Map::run (this=0x7fffffffd880) at ../../src/map/map.cpp:94
#5 0x000000000042fc5f in llmr::Map::__lambda5::operator() (__closure=0x0, arg=0x7fffffffd880) at ../../src/map/map.cpp:64
#6 0x000000000042fca2 in llmr::Map::__lambda5::_FUN (arg=0x7fffffffd880) at ../../src/map/map.cpp:65
#7 0x00000000005cf957 in uv.thread_start ()
#8 0x00007ffff77a3182 in start_thread (arg=0x7ffff1fa6700) at pthread_create.c:312
#9 0x00007ffff5c1a30d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) frame 2
#2 0x0000000000483172 in llmr::Painter::clearFramebuffers (this=0x7fffffffda08) at ../../src/renderer/painter_framebuffers.cpp:25
25 glDeleteFramebuffers((int)fbos.size(), fbos.data());
(gdb) p fbos.size()
$1 = 0
(gdb) p fbos.data()
$2 = (unsigned int *) 0x0
(gdb) list
20 if (fbo_depth_stencil != 0) {
21 glDeleteRenderbuffers(1, &fbo_depth_stencil);
22 fbo_depth_stencil = 0;
23 }
24
25 glDeleteFramebuffers((int)fbos.size(), fbos.data());
26 fbos.clear();
27 }
28
29 void Painter::bindFramebuffer() {

@preet
Copy link

preet commented Jun 18, 2014

Ran into the same issue, just wanted to confirm the patch fixed the problem for me:
(gdb) backtrace
#0 0x00007ffff2b0bf9c in ?? () from /usr/lib/libnvidia-glcore.so.331.38
#1 0x00007ffff2ac571e in ?? () from /usr/lib/libnvidia-glcore.so.331.38
#2 0x00000000004527cb in llmr::Painter::clearFramebuffers() ()
#3 0x0000000000424ad5 in llmr::Map::prepare() ()
#4 0x00000000004268f1 in llmr::Map::start()::{lambda(void_)#1}::FUN(void) ()
#5 0x00000000004e5957 in uv.thread_start ()
#6 0x00007ffff74a80a2 in start_thread () from /usr/lib/libpthread.so.0
#7 0x00007ffff4394d1d in clone () from /usr/lib/libc.so.6

@jfirebaugh
Copy link
Contributor

No longer applicable; glDeleteFramebuffers is never called with variable size now.

@jfirebaugh jfirebaugh closed this Dec 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants