View Single Post
Old 01-02-08, 12:10 PM   #1
deaton
Registered User
 
Join Date: Jan 2008
Posts: 1
Default Solaris 10 seg fault when using libdl to load libGL

Hi all,

I don't know if this is an appropriate forum for this question -- please point me in the right direction if you can.

I'm porting some GL code from linux to Solaris 10 and found that it was causing segmentation faults. I've reduced the code to a single file to highlight the problem (attached as libgldebug.cpp.txt). To compile, I've been using:

g++ -g -c -I /usr/X11/include/NVIDIA/ libgldebug.cpp
g++ -o libgldebug -lpthread -lX11 -lXext libgldebug.o

I'm using g++ version 3.4.5.

Briefly, the problem seems to arise from using multithreading (pthreads) in conjunction with lib DL (dynamic linking functions). I dynamically-programatically link libGL (grabbing the function "glxChooseVisual") and call it. If I make the call in one thread only, it succeeds, but for more than one thread it seg faults in libGL.so. This same code works *fine* in Linux. I'm very confused...

Thanks,
Dan
Attached Files
File Type: txt libgldebug.cpp.txt (1.3 KB, 175 views)
deaton is offline   Reply With Quote