Gentlemen, please tell me what the trick can be: a mutex is contained in a global structure, it is normally initialized, normally captured and released by threads, but only a few times ... The cycle in which work with this mutex is identical for all child threads passes valid 3-5 times, when trying to capture another pthread_mutex_lock generates SIGSEGV .
When parsing a dump in gdb, the segmentation error still comes up when accessing pthread_mutex_lock , but I strongly doubt that the problem is in the call. Directly by the debugger and valgrind is not yet close, the addresses that are passed to the function are valid, but an intriguing thing came out - got a variable in the thread stack, looped out its address a couple of times - it changed ... the value of the variable assigned to creating a stream is preserved. Washes someone faced with a similar?