A call to ibdev generates a SEGV.
I have a simple C program:
#include "ni488.h"
int main() {
int handle = ibdev(0, 7, 0, 10, 1, 0);
}
When I run it under gdb I get:
(gdb) start
Breakpoint 1 at 0x8048398: file nitest.c, line 4.
Starting program: /home/martell/src/nitest2/nitest
[Thread debugging using libthread_db enabled]
[New Thread 1076484320 (LWP 9844)]
[Switching to Thread 1076484320 (LWP 9844)]
main () at nitest.c:4
4 int handle = ibdev(0, 7, 0, 10, 1, 0);
(gdb) c
Continuing.
[New Thread 1085078448 (LWP 9847)]
[New Thread 1093471152 (LWP 9848)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1085078448 (LWP 9847)]
0x4005d609 in ?? () from /usr/local/lib/libgpibapi.so.2
If I run it under valgrind I get:
==9606== Thread 3:
==9606== Jump to the invalid address stated on the next line
==9606== at 0x0: ???
==9606== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==9606==
==9606== Process terminating with default action of signal 11 (SIGSEGV)
==9606== Access not within mapped region at address
0x0
]
==9606== at 0x0: ???
I am running on Mandrake Linux version 10.1.
What am I missing and/or doing wrong?
-larry