Date: Wed, 14 Oct 1998 22:17:35 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: kern/8324: failure to deliver SIGIO when fildes marked for async i/o Message-ID: <199810150517.WAA11996@bubba.whistle.com>
next in thread | raw e-mail | index | archive | help
>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 <archie@whistle.com> > 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 <fcntl.h> > #include <stdio.h> > #include <signal.h> > #include <unistd.h> > #include <errno.h> > #include <sys/ioctl.h> > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810150517.WAA11996>