apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucian Adrian Grijincu" <lucian.griji...@gmail.com>
Subject Re: [vote] Release apr[-util] 1.3.2
Date Tue, 17 Jun 2008 20:37:05 GMT
On Tue, Jun 17, 2008 at 22:24, Ruediger Pluem <rpluem@apache.org> wrote:
> Thanks for investigating, but keep two things in mind:
>
> 1. If errno is really 0 it would be a bug in your glibc / Linux kernel
>   as the man page is very clear about setting an error code in errno here.

Yeah, but if it /would/ be a bug in glibc shouldn't APR route around
the error somehow?
It's not an error, gdb was wrong.

> 2. I don't trust print errno here as errno in threaded environments (I
> assume
>   you compiled APR with thread support) is not a static variable as it was
>   in the past, but a macro wrapping something different in order to make the
>   whole errno process thread safe. So I guess it would be much safer here to
>   print the value that is returned in the calling function. Of course in our
>   case this is more difficult as the call is convoluted in a macro.
>   Maybe you can call apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p));
>   directly instead via APR_ASSERT_SUCCESS, assign the return value to a
> variable
>   and do a print via gdb afterwards.
apr_mmap_create returns 22 (Invalid argument).

│133         mm = mmap(NULL, size, native_flags, MAP_SHARED,
file->filedes, offset);
(gdb) print size
$3 = 16384
(gdb) print offset
$4 = 8589918208

man 2 mmap says:
> void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);

> EINVAL (since Linux 2.6.12), length was 0.
this cannot be it.

> EINVAL flags contained neither MAP_PRIVATE or MAP_SHARED, or  contained both of these
values.
neither can this.

> EINVAL We  don't  like  start,  length,  or  offset (e.g., they are too large, or not
aligned on a page boundary).
start=0
length=16384
offset=8589918208

Any ideas?

-- 
Lucian
Mime
View raw message