Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 06:26:12 -0800 (PST)
From:      Jin Guojin <jin@alonso.panasas.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/24559: aio_suspend() had Bus error when using -lc_r
Message-ID:  <200101231426.f0NEQC900617@alonso.panasas.com>

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

>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 <aio.h>
#include <fcntl.h>

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




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