Segmentation fault when using pthread_exit(NULL)

In the system test with clang and libc++ the dune-istl jobs are failing in all pythreadamgxyz tests with a segmentation fault, see

It seems to be related to the call to pthread_exit(NULL) and not returning anything from a function. This issue might be related to

Similar errors are reported

I guess it was just not showing an error so far, because relying on undefined behavior?

Edited by Simon Praetorius