From owner-freebsd-bugs Mon Jan 22 14:30:20 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D04CF37B402 for ; Mon, 22 Jan 2001 14:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0MMU1E02592; Mon, 22 Jan 2001 14:30:01 -0800 (PST) (envelope-from gnats) Received: from alonso.panasas.com (unknown [65.194.57.194]) by hub.freebsd.org (Postfix) with ESMTP id 9831237B69B for ; Mon, 22 Jan 2001 14:27:48 -0800 (PST) Received: (from jin@localhost) by alonso.panasas.com (8.11.1/8.11.1) id f0NEQC900617; Tue, 23 Jan 2001 06:26:12 -0800 (PST) (envelope-from jin) Message-Id: <200101231426.f0NEQC900617@alonso.panasas.com> Date: Tue, 23 Jan 2001 06:26:12 -0800 (PST) From: Jin Guojin Reply-To: jin@panasas.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/24559: aio_suspend() had Bus error when using -lc_r Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24559 >Category: kern >Synopsis: aio_suspend() had Bus error when using -lc_r >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 22 14:30:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Jin Guojin >Release: FreeBSD 4.2-RELEASE i386 >Organization: >Environment: 4.2-RELEASE >Description: aio_suspend() gets Bus error when used in thread ENV (-lc_r). This works in 3.5-RELEASE. >How-To-Repeat: The following code works well when compiled as cc -g test.c but core dumps when compiled as cc -g test.c -lc_r ----------------------- cut ------------------- # include #include main() { char *dev = "/dev/ad0"; int i, r_size=4096; struct aiocb aiocb = {0}; const struct aiocb *aiocbp = &aiocb; aiocb.aio_offset = 0; aiocb.aio_nbytes = r_size; aiocb.aio_fildes = open(dev, O_RDONLY); if (aiocb.aio_fildes < 0) errx(1, "open %s\n", dev); aiocb.aio_buf = malloc(r_size); if ((i=aio_read(&aiocb)) < 0) errx(2, "aio_read"); if (!i) aio_suspend(&aiocbp, 1, NULL); free(aiocb.aio_buf); } ----------------------- cut ------------------- >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message