NetBSD Problem Report #53612

From o.vd.linden@quicknet.nl  Sun Sep 16 17:48:29 2018
Return-Path: <o.vd.linden@quicknet.nl>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6C3777A151
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 Sep 2018 17:48:29 +0000 (UTC)
Message-Id: <20180916174824.GA27650@sheep>
Date: Sun, 16 Sep 2018 19:48:24 +0200
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@netbsd.org
Subject: 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.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.