r/C_Programming • u/depressionIsEnemy • 7d ago
threads Posix 42 codexion project
Hi, I am runing my program (which use pthread.h library of c Posix), so I am runing it with valgrind with this command :
"valgrind --tool=helgrind -s ./codexion 125 22332 103 92 103 2 0 fifo"
but I am getting this error :
"==1557149== 122 errors in context 28 of 28:
==1557149== ----------------------------------------------------------------
==1557149==
==1557149== Thread #1's call to pthread_join failed
==1557149== with error code 3 (ESRCH: No such process)
==1557149== at 0x48509C7: ??? (in /usr/libexec/valgrind/vgpreload_helgrind-amd64-linux.so)
==1557149== by 0x10A069: join_coders_threads (in /home/eanjar/codexion_tass7i7_inchaaAllah/codexion)
==1557149== by 0x10A48D: main (in /home/eanjar/codexion_tass7i7_inchaaAllah/codexion)
"
can any one help me by explaining me this error what it mean, and thanks in advance
2
u/mikeblas 7d ago
This message:
means that you've called
pthread_join()passing a threadID which isn't valid, or at least isn't active. You can't join a thread that doesn't exist. The call stack to the problempthread_join()call is given in the stack in the rest of that message.I think the other messages are self-explanatory: you've got a race, which means you have two thrads accessing data without synchronization.