From owner-freebsd-bugs Wed Oct 14 22:20:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA04824 for freebsd-bugs-outgoing; Wed, 14 Oct 1998 22:20:09 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA04779 for ; Wed, 14 Oct 1998 22:20:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id WAA07795; Wed, 14 Oct 1998 22:20:01 -0700 (PDT) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA04567 for ; Wed, 14 Oct 1998 22:17:54 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id WAA06764 for ; Wed, 14 Oct 1998 22:17:38 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma006760; Wed Oct 14 22:17:35 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id WAA11996; Wed, 14 Oct 1998 22:17:35 -0700 (PDT) Message-Id: <199810150517.WAA11996@bubba.whistle.com> Date: Wed, 14 Oct 1998 22:17:35 -0700 (PDT) From: Archie Cobbs Reply-To: archie@whistle.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/8324: failure to deliver SIGIO when fildes marked for async i/o Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 8324 >Category: kern >Synopsis: failure to deliver SIGIO when fildes marked for async i/o >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 14 22:20:00 PDT 1998 >Last-Modified: >Originator: Archie Cobbs >Organization: Whistle Communications, Inc. >Release: FreeBSD 2.2.6-RELEASE i386 >Environment: 2.2.7 and 3.0 >Description: Run the program below. It will periodically hang until you press return (which causes a readability condition). It should (as far as I can tell) generate continuous output without pausing at all. >How-To-Repeat: > From majordom@FreeBSD.ORG Wed Oct 14 18:42:26 1998 > From: Archie Cobbs > Message-Id: <199810150118.SAA02921@bubba.whistle.com> > Subject: bug with SIGIO? > To: freebsd-hackers@FreeBSD.ORG > Date: Wed, 14 Oct 1998 18:18:55 -0700 (PDT) > X-Mailer: ELM [version 2.4ME+ PL38 (25)] > MIME-Version: 1.0 > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > Sender: owner-freebsd-hackers@FreeBSD.ORG > Precedence: bulk > X-Loop: FreeBSD.ORG > Status: RO > > Hi, > The program included below seems to indicate a bug with SIGIO, > in that the process is not always getting signalled when the > file descriptor is writable. > > If you run this program, it outputs for a while, then stops, > then resumes when you hit return (which causes a readable condition). > > I've verified this behavior in 2.2.7 but not 3.0-current. > > Q1. Is this in fact a bug, or else a misunderstanding? > Q2. If this is not a bug, what is the correct way to do this? > > I apologize if this is already know; didn't find anything > in the PR database. > > Thanks, > -Archie > > ___________________________________________________________________________ > Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com > > #include > #include > #include > #include > #include > #include > > void catch() { } > > int > main(int ac, void *av[]) > { > sigset_t empty, block; > int on = 1; > > fcntl(1, F_SETFL, O_NONBLOCK); > ioctl(1, FIOASYNC, &on); > > sigemptyset(&empty); > sigemptyset(&block); > sigaddset(&block, SIGIO); > sigprocmask(SIG_BLOCK, &block, NULL); > signal(SIGIO, catch); > > for (;;) { > int w = write(1, "!@#$%", 5); > if (w < 0 && errno == EWOULDBLOCK) { > sigsuspend(&empty); > write(1, " resumed ", 7); > } > } > } > >Fix: ?? >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message