Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Feb 1999 03:20:54 -0800 (PST)
From:      steve@spvi.com
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   misc/9903: thread enabled program can't use popen/system more than once when called from cron
Message-ID:  <199902041120.DAA26930@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb  4 03:30:00 PST 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902041120.DAA26930>