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

Newegg Daily Deals

Reply
 
Thread Tools
Old 12-26-08, 05:25 PM   #1
583mdg
Registered User
 
Join Date: Dec 2008
Posts: 2
Default freebsd issue compiling any program with -lopenal and -lGL

Hello. I am having trouble compiling a program with an nvidia provided libGL and the libopenal libraries in freebsd

I am running FreeBSD 7.1-RC1, GeForce4 Ti 4200 with AGP8X, and the nvidia graphics driver from ports: nvidia-driver-96.43.07. I have openal installed from ports: openal-20060211_7.

Basically, what seems to be happening is that when I compile a program dynamically linked against openal and libGL, the program segfaults whenever you try to run it.

It seems that if all openal related libraries are linked after all openGL libraries, the program is fine, but I am not sure about this. It still segfaults in some cases - maybe when other libGL libraries are linked afterward? like libGLcore.

Here is what I do to cause the problem to happen:

test.c:
Code:
int main(){
	return(1);
}
I run the following:
Code:
gcc -g test.c -o test.bin -L/usr/X11R6/lib/ -L/usr/local/lib -lopenal -lGL
The program does the following:
Code:
>./test.bin
Segmentation fault: 11 (core dumped)
gdb shows the following:
Code:
>gdb test.bin
...
(gdb) run
Starting program: /usr/home/matt/work/test.bin 
[New LWP 100157]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 100157]
0x4826a2c2 in pthread_mutexattr_setkind_np () from /lib/libthr.so.3
(gdb) backtrace
#0  0x4826a2c2 in pthread_mutexattr_setkind_np () from /lib/libthr.so.3
#1  0x480df0c3 in _nv000007gl () from /usr/local/lib/libGL.so.1
#2  0xbfbfe6c0 in ?? ()
#3  0x00000002 in ?? ()
#4  0x0000000a in ?? ()
#5  0x480df130 in _nv000007gl () from /usr/local/lib/libGL.so.1
#6  0x480df100 in _nv000007gl () from /usr/local/lib/libGL.so.1
#7  0x00000000 in ?? ()
#8  0x48079330 in ?? ()
#9  0x483b22d0 in _nv001238gl () from /usr/local/lib/libGLcore.so.1
#10 0xbfbfe728 in ?? ()
#11 0x4868409b in _nv000387gl () from /usr/local/lib/libGLcore.so.1
#12 0x00000000 in ?? ()
#13 0x48079330 in ?? ()
#14 0xbfbfe8b8 in ?? ()
#15 0x480f6dff in _init () from /usr/local/lib/libGL.so.1
#16 0xbfbfe728 in ?? ()
#17 0x48070734 in ?? () from /libexec/ld-elf.so.1
#18 0x4804e50c in dlsym () from /libexec/ld-elf.so.1
#19 0x4804f7e9 in dlopen () from /libexec/ld-elf.so.1
#20 0x4804a44e in ?? () from /libexec/ld-elf.so.1
(gdb)
If I swap -lopenal and -lGL, no segfault happens. But it is still happening in more complicated programs I am trying to build, where other GL libraries are being loaded, and where GL is actually being used in the program. All other cases seem to have the exact same backtrace.

Any help would be appreciated.
583mdg is offline   Reply With Quote
Old 12-29-08, 05:39 AM   #2
HenryHu
Registered User
 
Join Date: Aug 2008
Posts: 24
Default Re: freebsd issue compiling any program with -lopenal and -lGL

try -pthread?
HenryHu is offline   Reply With Quote
Old 01-02-09, 10:41 AM   #3
583mdg
Registered User
 
Join Date: Dec 2008
Posts: 2
Default Re: freebsd issue compiling any program with -lopenal and -lGL

Thank you. It worked, even though I don't understand what it is.
583mdg 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


All times are GMT -5. The time now is 09:38 AM.


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