Attention is currently required from: osmith, lynxis lazus. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/27739 )
Change subject: Fix use-after-free by tun thread after tun obj destroyed ......................................................................
Patch Set 3:
(1 comment)
File daemon/tun_device.c:
https://gerrit.osmocom.org/c/osmo-uecups/+/27739/comment/cfa1f163_2d0db5d9 PS3, Line 200: pthread_cleanup_pop(1);
Daniel already asked, but it's not answered and I don't see it: how do you reach this, since there's […]
Sorry we discussed this through jabber since it's a bit of a complex topic. In summary, check "man pthread_cleanup_push". push/pop can be implemented as a while loop, as specified by POSIX. And if you check /usr/include/pthread.h, it is actually implemented that way in linux. This adds further restrictions, like having to put both push/pop, and having to put them in the same function block.
So in reality the function is not called, and we don't need it called, but it's needed to make the "do while" block.