NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/53612: compiling with -pg causes pthread_join to wait forever



>Number:         53612
>Category:       lib
>Synopsis:       compiling with -pg causes pthread_join to wait forever
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 16 17:50:00 +0000 2018
>Originator:     Onno van der Linden
>Release:        NetBSD 8.99.24
>Organization:
>Environment:
System: NetBSD sheep 8.99.24 NetBSD 8.99.24 (SHEEPKMS) #4: Sat Aug 11 11:29:18 CEST 2018 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEPKMS i386
Architecture: i386
Machine: i386
>Description:
Run program below compiled with cc -pthread whatever.c and
the before and after messages are printed
Run program below compiled with cc -pg -pthread whatever.c and
only the before message is printed.
Using -static as an extra option gives the same results.

#include <pthread.h>
#include <unistd.h>

void *dowait(void *arg) { sleep(1); pthread_exit(NULL); }

int main(void)
{
	pthread_t pthid;

       if (pthread_create(&pthid, NULL, dowait, NULL) == 0) {
		write(1,"before join\n", 12);
		pthread_join(pthid, NULL);
		write(1,"after join\n", 11);
	}
}
>How-To-Repeat:
Run test progam compiled with and without -pg
>Fix:
No idea what the influence of -pg is and if this is a lib category PR.



Home | Main Index | Thread Index | Old Index