Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

libnipalu.so.1 Segmentation Fault openSUSE 11.4

I am trying to use the NIDAQmx library in a custom application on a machine running openSUSE 11.4 (kernel version 2.6.37.6). I have successfully compiled the kernel modules etc (following advice on these boards regarding modifying NIKAL source files, and openSUSE-specific instructions). DAQmxTestPanels runs successfully, and nilsdev recognizes the card I have installed.

However, upon loading libnidaqmx.so into my application, I am getting a segmentation fault. I have not included any NI header files or functions in my application; the crash is simply a result of linking libnidaqmx. Below is a backtrace, though I don't have debugging symbols installed for NI software. Any idea if this is something wrong on my end?

Thread 1 (Thread 0xb5f8fb10 (LWP 9686)):
#0  0xb6579b0d in libLoad(iLib::tParamLoad const&, long*) () from /usr/local/lib/libnipalu.so.1
No symbol table info available.
#1  0xb60d33fb in nNIMXP100::tCPUCycleCounter::tCPUCycleCounter() () from /usr/local/lib/libnimxpu.so.1
No symbol table info available.
#2  0xb60cbf63 in ?? () from /usr/local/lib/libnimxpu.so.1
No symbol table info available.
#3  0xb60cc0c2 in ?? () from /usr/local/lib/libnimxpu.so.1
No symbol table info available.
#4  0xb60d3175 in ?? () from /usr/local/lib/libnimxpu.so.1
No symbol table info available.
#5  0xb60cb53e in ?? () from /usr/local/lib/libnimxpu.so.1
No symbol table info available.
#6  0xb7fed779 in call_init () from /lib/ld-linux.so.2
No symbol table info available.
#7  0xb7fed8c4 in _dl_init_internal () from /lib/ld-linux.so.2
No symbol table info available.
#8  0xb7fdf88f in _dl_start_user () from /lib/ld-linux.so.2
No symbol table info available.
0 Kudos
Message 1 of 4
(6,283 Views)

In case anyone else runs across this, here's the relevent section of the README file, which I had overlooked:

Linking with the pthread Library

--------------------------------

In C or C++, use care if your NI-DAQmx application links to the Linux pthread

library. It is recommended to link your application with the gcc -pthread flag

instead of linking directly with, for instance, -lpthread. Incorrect linking

can lead to segmentation faults when the NI-DAQmx libraries load. If, after

replacing -lpthread, you still get a segmentation fault when loading NI-DAQmx,

you must explicitly link the dl library (-ldl) as the first library in your

list.

My build tool was linking directly with -lpthread. By linking with the -pthread flag instead, the segmentation fault is avoided.

0 Kudos
Message 2 of 4
(3,135 Views)

Can I ask please have you got NI-VISA installed and are you managing to communicate over USB with a piece of test gear with SuSE 11.4? I really want to use Linux for a piece of test gear I'm designing and have got stuff communicating using TekVisa on a Windows machine. I've tried Mandriva 2010 and SuSE 11.2, neither of which work. (With SuSE it's as much as SuSE itself that is past its sell by date.) 

0 Kudos
Message 3 of 4
(3,135 Views)

I have installed NI-VISA, but I have not yet tried to communicate with a device over USB. I am planning to interface with a device in the next week or so, but I don't know whether it will be over USB or RS232 yet. I will let you know how it goes.

0 Kudos
Message 4 of 4
(3,135 Views)