| Summary: | AGP RELEASE ioctl frees memory | ||
|---|---|---|---|
| Product: | Base System | Reporter: | simonw <simonw> |
| Component: | kern | Assignee: | dfr |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: freebsd-bugs->dfr Over to the author of the code. State Changed From-To: open->closed Fixed in r1.14 of agp.c (in 2001). |
The implementation of the ioctl AGPIOC_RELEASE includes the following code: /* * Clear out the aperture and free any outstanding memory blocks. */ while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) { if (mem->am_is_bound) AGP_UNBIND_MEMORY(dev, mem); AGP_FREE_MEMORY(dev, mem); } Clearly this deallocates all the memory that the application has attached to the AGP space. Yet the spec for the agp ioctls (at least the one I have) states that this ioctl merely releases control of the agp device - it doesn't deallocate memory that the app allocated while it had control. That is done with the UNBIND and DEALLOCATE commands. The Utah GLX code certainly assumes this behaviour - I had to comment out the RELEASE ioctl to get it to work with FreeBSD. Fix: I think just taking out the code segment given above will suffice. How-To-Repeat: Use Xfree86 3.3.5 with the Utah GLX module (add -DHAVE_LINUX_NEWAGP). It will complain about