Something weird is happening with my software.
I have a thread wich reads a file and write to a RM.
This thread have a while(1) loop and is blocked using pthread_cond_wait();
The first time the thread is unblocked, it first open 2 files (fd_cfg=3 and fd_rm=4), then I make a read() call in fd_cfg and a write() in fd_rm, then block again.
The next time the thread is unblocked, this variables have different values (as if it was accessing invalid memory address) and I got an error (of course). But, I’m sure I’m not changing this values anywhere in the program.
I tried to make fd_cfg and fd_rm as global variables and test again, this time the values looks right (3 and 4) but gdb returned me a SIGTRAP fault!
I’m using QNX 6.1 - gcc 2.95.2