Bug#140476: libc6: mmap sets errno to EINVAL not ENOMEM
> Package: libc6
> Version: 2.2.5-3
> Severity: normal
>
> Looks like an attempt to mmap an area that is too big for the processes
> address space[1] causes mmap to return EINVAL instead of ENOMEM.
> According to the docs of the LSB test suite, it should be ENOMEM:
>
> If _POSIX_SHARED_MEMORY_OBJECTS is defined or the implementa-
> tion supports the mmap() function as defined in System
> Interfaces and Headers, Issue 5 and the implementation
> supports MAP_FIXED:
> A call to mmap() when MAP_FIXED is specified and the range
> [addr,addr+len] exceeds that allowed for the address space of
> a process shall return MAP_FAILED and set errno to ENOMEM.
>
> [1] The test program does this by mmapping half of the processes address
> space, and then mmaping 1 page less than the number of pages in the
> address space, which of course fails..
Please show us the test case. BTW, this bug is a bit obsolete, so I
think it should be checked with the latest glibc 2.3.2.ds1-13. If you
don't have any interests in this bug, please let me know to close it.
Regards,
-- gotom
Reply to: