Closed julianmorillo closed 1 week ago
Is this the same issue that was reported by e-mail? If so, for reference, please try commenting out the following call at src/tracer/wrappers/pthread/pthread_wrapper.c at line 240:
//Backend_Flush_pThread (pthread_self());
Does this fix the issue?
Yes, it is the same issue that I reported by e-mail.
Yes!, this fix the issue... Now the PTHREAD test pass. Is this a proper fix or just a workaround?
It is a sort of a proper fix. The call to Backend_Flush_pThread happens at the end of the "start_routine" executed by pthread_create before the thread dies, and makes it write its own trace data to disk. The problem with this is that a thread might not finish before the main thread and never exit the "start_routine", so its flush of the trace never happens, and we need the master thread to do a final flush at the end of the process to recover all thread's data. Having two points in the execution where a given pthread's data might be dumped concurrently is generating some known race condition problems, and since we can't avoid the final flush to deal with the threads that don't finish, we'll probably eliminate the first flush point.
The test provided with the source code under
tests/functional/tracer/PTHREAD
fails with the following output:Running just the binary
./pthread
works fine and preloading any other library not tracing pthreads (for example, libseqtrace.so) also prevents the Segmentation fault to occur. I'm running in arriesgado-4 (RISC-V machine).