| Summary: | aio_suspend() had Bus error when using -lc_r | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Jin Guojin <jin> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.2-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
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> 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> State Changed From-To: open->closed Feedback timeout. |
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 -------------------