# TRentrantRWlock thread lock, program freezes

**URL:** <https://root-forum.cern.ch/t/trentrantrwlock-thread-lock-program-freezes/45116>\
**Category:** ROOT\
**Created:** [May 27, 2021, 3:31pm UTC](https://root-forum.cern.ch/t/trentrantrwlock-thread-lock-program-freezes/45116 "2021-05-27T15:31:31Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [May 30, 2021, 10:41pm UTC](https://root-forum.cern.ch/t/trentrantrwlock-thread-lock-program-freezes/45116/12 "2021-05-30T22:41:21Z")

</div>

Alright, I came up with a (more or less) small reproducer.  
[zdt.zip](https://root-forum.cern.ch/uploads/short-url/z59x8uBIVMEE5S46EWUUHyyO3df.zip) (73.2 KB)

By adding several artificial printfs and stuff like that, I managed to get reproducible ‘freezes’ in two different computers. It always get stuck, though sometimes with an internal TTimer from TGCommandPlugin, sometimes with the normal timers from TApplication.Run (TUnixsystem).

I do:

```auto
mkdir build && cd build
make
gdb --args ../build/gui/runGUI --prbs 26 -q
Gets stuck...
CTRL+C
info threads
thread apply all bt
print (('ROOT::TReentrantRWLock<std::mutex, ROOT::Internal::RecurseCounts>' * const)ROOT::gCoreMutex)->fMutex

```

First one needs to clone the CLI11 repository as explained in the README file.

Thanks!!

---

_[View the full topic](https://root-forum.cern.ch/t/trentrantrwlock-thread-lock-program-freezes/45116)._
