Bug 24559

Summary: aio_suspend() had Bus error when using -lc_r
Product: Base System Reporter: Jin Guojin <jin>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   

Description Jin Guojin 2001-01-22 22:30:01 UTC
	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 -------------------
Comment 1 Mark Valentine 2002-04-30 03:38:52 UTC
I can't reproduce this on a 4.5-RELEASE system, using a kernel with
VFS_AIO (on a SCSI system with /dev/da0 instead of /dev/ad0), or on
a GENERIC kernel with an IDE disk.  I tried both with -lc_r and with
cc -thread.

Is it still a problem?

		Cheers,

		Mark.

-- 
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk>       <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich."       Mark Valentine uses
"We're kind of stupid that way."   *munch* *munch*        and endorses FreeBSD
  -- <http://www.calvinandhobbes.com>                  <http://www.freebsd.org>
Comment 2 Mark Valentine 2002-04-30 03:46:30 UTC
Mail to submitter bounces.  I guess
This PR can be closed

-- 
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk>       <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich."       Mark Valentine uses
"We're kind of stupid that way."   *munch* *munch*        and endorses FreeBSD
  -- <http://www.calvinandhobbes.com>                  <http://www.freebsd.org>
Comment 3 Mark Peek freebsd_committer freebsd_triage 2002-07-28 19:12:24 UTC
State Changed
From-To: open->closed

Feedback timeout.