Bug#570889: #570889 ant: FTBFS on kfreebsd-* and hppa: Bus error

Carlos O'Donell carlos at systemhalted.org
Fri Feb 26 03:37:12 UTC 2010


On Thu, Feb 25, 2010 at 7:22 PM, Petr Salinger <Petr.Salinger at seznam.cz> wrote:
>> On Thu, Feb 25, 2010 at 9:23 AM, Petr Salinger <Petr.Salinger at seznam.cz>
>> wrote:
>>>
>>> The file, which have to be copied, have size 1701,
>>> but two pages (2*4096) are mmaped. It is allowed on both
>>> Linux and FreeBSD.
>>> When the 2nd page of that file would be accessed, it would
>>> generate SIGBUS.
>>>
>>> The question is of course whether it really happens and why ?
>
>> File descriptor 0 is standard input and you can't mmap that.
>> You should also check the return of mmap.
>> Could you please provide a new test case?
>
> Please really try to run the example code,
> for me (pagesize 4096) it gives:
>
> 0x800636000 32
> 0x800636000 0
> Bus error
>
> The example code just illustrates what might happen in
> failure of ant. The affected architectures directly in
> ant build have been only kfreebsd-* and hppa.
>
> Now it looks like wider problem - #571532, #571542, #571397.

Does ant actually try to mmap stdin? That's a bug in ant.

POSIX says you may only mmap a file, shared memory object,
or typed memory object. The stdin file descriptor is neither
of those things therefore you can't mmap stdin.

One might argue the bug is that the Linux kernel allows the
mmap to succeed.

Cheers,
Carlos.





More information about the pkg-java-maintainers mailing list