Unfortunately I cannot give exact description since the same code
sometimes works somtimes doesn't.
I am using Gentoo with 2.16.14+reiser4 kernel. gcc-3.4.5, NI_PCMCIA
card (tnt4882 driver), linux-gpib v.3.2.06, IBM Thinkpad T42p . The
software I am writing utilizes next functions from th the library:
ibopen
ibwrt
ibrd
The problem appears after some (more than 10) writes (ibwrt) and
reads (ibrd) in the same program. The addresses of some variables
which have no any relation to the libgpib and are not used in the
same functions where libgpib functionality is involved, are totally
mixed. The functions from the library itself return absolutely correct
results. Sometimes very stupid things like inserting a line
printf(" \n");
after ibrd(...) repairs the situation. However, I am sure that the
problem is in the libgpib: when I change the string
ibrd( ud, (void*) result, size_of_result );
by the
strcpy(result, "some test result");
everything works perfectly.
Thank you for your work.
Logged In: YES
user_id=129750
You're going to have to provide example code that
segfaults to convince me this is a library bug. A
strcpy() is not equivalent to the result of an ibrd.
Maybe you're not null-terminating the result from the
ibrd?