https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79876
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Of course, the testcase was not using libgomp at all and OMP_STACKSIZE is an env var used by libgomp only. So, this means whatever darwin libpthread are using is using extremely small default for the pthread_create stack size (.5MB) unless overridden (i.e. when pthread_create is called with NULL as attribute; maybe also when called with pthread_attr_init created attr without pthread_attr_setstacksize - you could test this by commenting out pthread_attr_setstacksize (&at2, 2048 * 1024); line, recompile/relink/rerun the testcase. Can you try some other darwin versions if you have access to them?