using dlopen against a nvidia libgl library cause werid crash in another unrelated place in pthread

First, I don’t really have a nvidia card, the problem is reported by at least two of my application user.

Here is the case,
Archlinux enable gl for cairo in order to support wayland, my application uses cairo (by dlopen a plugin linked to cairo, but it doesn’t use opengl at all). So my application pulls in nvidia libgl by cairo now.

the main program only links to some libc library and pthread, and dl.
The problem will occur when it loads a library using curl (which uses pthread), and it will generate werid crash with impossible call stack, so the memory might be somehow corrupted.

And this only happens if the user is using the nvidia libGL library as their libGL.

I found some info about single-threaded and pthread case, but it doesn’t match my case exactly, so I don’t know whether I did something wrong and hit a problem with nvidia libGL.

All dlopen call is called with RTLD_NOW | RTLD_GLOBAL.

The user reports this problem to me have tested with both 313.18, and 313.26.

Did you read FAQ and knownissues in README?
The latest version is
ftp://download.nvidia.com/XFree86/Linux-x86/313.26/README/knownissues.html

When I had similar problems, I used the following workarounds;

  • export LD_PRELOAD="/path/to/libpthread.so.0 /path/to/libGL.so.1"
  • prelink -u

Thanks for reporting this, csslayer. Can you please provide a standalone test case that we can use to reproduce this problem?