https://bugs.kde.org/show_bug.cgi?id=451327
--- Comment #2 from Paul Floyd <pjfl...@wanadoo.fr> --- Answering my own question. On Linux, if I add pthread_join: static void use_stack_allocated_semaphore(void) { sem_t sem; sem_init(&sem, 0, 0); pthread_t t; pthread_create(&t, NULL, post_thread, &sem); sem_wait(&sem); sem_destroy(&sem); pthread_join(t, NULL); } then I get no error ==17867== Helgrind, a thread error detector ==17867== Copyright (C) 2007-2017, and GNU GPL'd, by OpenWorks LLP et al. ==17867== Using Valgrind-3.20.0.GIT and LibVEX; rerun with -h for copyright info ==17867== Command: ./451327 ==17867== ==17867== ==17867== Use --history-level=approx or =none to gain increased speed, at ==17867== the cost of reduced accuracy of conflicting-access information ==17867== For lists of detected and suppressed errors, rerun with: -s ==17867== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -- You are receiving this mail because: You are watching all bug changes.