Well, I'm surprised that this thread is active again after one year
😉I think I have narrowed the location of the problem. It seems to be in the
TimeInSecs function of the library
liblvrtdark.so.8.0. The following are the tests I did that lead me to think that.
Just for fun, as JHn suggested, I've tried to see into /var/log/messages while running the examples I provided but nothing happens. The strace command is more useful. Running "strace ./withNIDAQmxBase" gives a lot of messages. The last lines are:
access("/usr/local/lib/liblvrtdark.so.8.0", R_OK) = 0
lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/usr/local/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/usr/local/lib/liblvrtdark.so.8.0", {st_mode=S_IFLNK|0777, st_size=32, ...}) = 0
readlink("/usr/local/lib/liblvrtdark.so.8.0", "LabVIEW-8.0/liblvrtdark.so.8.0.1", 4096) = 32
lstat64("/usr/local/lib/LabVIEW-8.0", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/usr/local/lib/LabVIEW-8.0/liblvrtdark.so.8.0.1", {st_mode=S_IFREG|0644, st_size=7050640, ...}) = 0
open("/usr/local/lib/LabVIEW-8.0/liblvrtdark.so.8.0.1", O_RDONLY) = 5
read(5, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340f\5"..., 512) = 512
fstat64(5, {st_mode=S_IFREG|0644, st_size=7050640, ...}) = 0
close(5) = 0
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 😎 = 0
write(4, "\240\306h\267\0\0\0\0\340\352\332\267\320P\203\267\320"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 😎 = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
<... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [RTMIN])
gettimeofday({1183025545, 797204}, NULL) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Process 3089 detached
So the process seems to load the
liblvrtdark.so.8.0 library and just before it die it call the
gettimeofday system call. Well, not so bad, but the call to
gettimeofday seems to work properly (the numbers that appears in {...,...} are indeed the actual seconds and microseconds of the
timeval struct ).
So, lets try running
gdb:
[root@host nidaqmxbase-exit-bug]# gdb withNIDAQmxBase
GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /tmp/nidaqmxbase-exit-bug/withNIDAQmxBase
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 3018)]
[New Thread 32769 (LWP 3021)]
[New Thread 16386 (LWP 3022)]
[Thread 16386 (LWP 3022) exited]
[New Thread 32771 (LWP 3023)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 3018)]
0xb781f6be in TimeInSecs () from /usr/local/lib/liblvrtdark.so.8.0
(gdb) quit
The program is running. Exit anyway? (y or n) y
[root@host nidaqmxbase-exit-bug]#
So the segmentation fault occurs in a function called
TimeInSecs int the
liblvrtdark.so.8.0. To check that a function of this name exists we can use the nm command:
[root@host nidaqmxbase-exit-bug]# nm --debug-syms --dynamic /usr/local/lib/liblvrtdark.so.8.0 | grep TimeInSecs
000b6630 T TimeInSecs
[root@host nidaqmxbase-exit-bug]#So the strange segmentation fault must be related with some bug in the "pointer logic" of the
TimeInSecs.
Anyone from NI that could see the
TimeInSecs source code and give us some light at this ... or fix the bug
😉Bye!