From nobody  Thu Feb  4 03:20:54 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id DAA26930;
          Thu, 4 Feb 1999 03:20:54 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199902041120.DAA26930@hub.freebsd.org>
Date: Thu, 4 Feb 1999 03:20:54 -0800 (PST)
From: steve@spvi.com
To: freebsd-gnats-submit@freebsd.org
Subject: thread enabled program can't use popen/system more than once when called from cron
X-Send-Pr-Version: www-1.0

>Number:         9903
>Category:       misc
>Synopsis:       thread enabled program can't use popen/system more than once when called from cron
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb  4 03:30:00 PST 1999
>Closed-Date:    Fri Dec 17 13:23:07 PST 1999
>Last-Modified:  Fri Dec 17 13:24:45 PST 1999
>Originator:     Steve Spicklemire
>Release:        2.2.8-STABLE
>Organization:
Silicon Prairie Ventures Inc
>Environment:
FreeBSD acer.spvi.com 2.2.8-RELEASE FreeBSD 2.2.8-RELEASE #0: Mon Feb  1 06:13:17 EST 1999     steve@acer.spvi.com:/usr/src/sys/compile/MYKERNEL  i386
>Description:
When a thread enabled program (linked to libc_r) is run from
cron, it will block on the second call to system/popen.
>How-To-Repeat:
Compile this program:

gcc -pthread -g -o problem problem.c

---------------------------------------------------
#include <stdio.h>

main()
{
  printf("before touching one....\n");
  fflush(stdout);
  system("touch /tmp/one.txt");
  system("touch /tmp/two.txt");
  printf("after touching two.....\n");
  fflush(stdout);

}

-----------------------------

run from cron... observe.

program blocks in thread_sys_select().

>Fix:
don't run thread enabled programs that call system/popen from cron.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jasone 
State-Changed-When: Fri Dec 17 13:23:07 PST 1999 
State-Changed-Why:  
deischen's fixes to libc_r with regard to thread wakeup and wait4() on 
16 December 1999 resolve this PR. 
>Unformatted:
