Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 05-17-03, 10:41 AM   #1
scragnet
Registered User
 
Join Date: May 2003
Posts: 5
Default Seg-faults in GL when dynamically loading pthread

Hi,

I've been working writing on some extensions for quakeforge and I've come across an interesting problem:

When I load a shared library that uses the pthread library, GL seg-faults while rendering the next frame. This only happens on GL clients with the nVidia GL library.

If the pthread library is linked in to quakeforge's GL renderer, the seg-fault does not occur. This suggests to me that the nVidia GL library is using pthread if it is present, but doesn't work cleanly with it unless it has been initialized before any GL operations begin.

Is there any way that we can deal with this problem aside from linking in pthread when using the nVidia GL library?
scragnet is offline   Reply With Quote
Old 05-17-03, 11:45 AM   #2
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

When you say "load a shared library", do you mean calling dlopen() on it?

There is a question in the driver README, in the FAQ section, that covers issues calling dlopen() on shared libraries (on the libGL.so specifically, but due to the problem's cause, I wouldn't be surprised if the same issue would cause problems on libpthread.so too).
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 05-17-03, 02:29 PM   #3
scragnet
Registered User
 
Join Date: May 2003
Posts: 5
Default

> When you say "load a shared library", do you mean calling dlopen() on it?

Yes. That's exactly what I mean.

I have no problems loading any other shared libraries dynamically, only pthread, but I'll take a look at the FAQ - thanks.
scragnet is offline   Reply With Quote
Old 05-17-03, 07:15 PM   #4
scragnet
Registered User
 
Join Date: May 2003
Posts: 5
Default

From the README:

> o Interaction with pthreads
> Single threaded applications that dlopen() NVIDIA's libGL
> library, and then dlopen() any other library that is linked
> against pthreads will crash in NVIDIA's libGL library. This does
> not happen in NVIDIA's new ELF TLS OpenGL libraries (please see
> (app-c) APPENDIX C: INSTALLED COMPONENTS for a description of
> the ELF TLS OpenGL libraries). Possible work arounds for this
> problem are:

> 1) Load the library that is linked with pthreads before
> loading libGL.so.
> 2) Link the application with pthreads.

Pretty much the work-arounds I was hoping to avoid :-/ The other option is to upgrade to GLIBC 2.3+ so that the ELF TLS libs can be used.
scragnet is offline   Reply With Quote
Old 05-17-03, 10:35 PM   #5
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

That's not the question I was thinking of, but yeah, that is the problem.

I was thinking it was a bug in your glibc, but never mind, it's not. It's that.

Upgrading to glibc 2.3 won't necessarily help, either -- you need the end users to all have the TLS libGL installed on their systems, and that's a function of the kernel and glibc both, I think. I believe that no distros other than RH 9 need the TLS libGL (though I'm building a Linux From Scratch with glibc 2.3.2 and kernel 2.4.20 -- glibc has TLS, but the kernel won't -- to see which libs the installer uses for that kind of setup), because only RH9 uses the kernel implementation of TLS. Could be wrong, though...
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 05-18-03, 04:03 PM   #6
scragnet
Registered User
 
Join Date: May 2003
Posts: 5
Default

We'll probably end up just putting a check in "configure": if nvidia gl and pthread is installed, link it into the GL renderer. Kinda icky, but it solves the problem.

Thanks for your help, bwkaz :-)
scragnet is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
X Failed to load NVdriver c00lr4c3r NVIDIA Linux 13 10-22-02 01:44 PM
Error messages... HELP!!!! Imperito NVIDIA Linux 3 09-24-02 10:46 PM
GForce drivers installed...but dont work tomfullery NVIDIA Linux 6 09-22-02 08:23 AM
Need help to get the X to work on my Acer TravelMate 630 knchee NVIDIA Linux 16 09-19-02 10:16 PM
RH7.3 and nForce - can't find the module dmw400 NVIDIA Linux 4 08-05-02 12:14 PM

All times are GMT -5. The time now is 04:59 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.