apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: [vote] Release apr[-util] 1.3.2
Date Tue, 17 Jun 2008 19:24:36 GMT


On 06/17/2008 08:55 PM, Lucian Adrian Grijincu wrote:
> On Tue, Jun 17, 2008 at 19:25, Lucian Adrian Grijincu
> <lucian.grijincu@gmail.com> wrote:
>> On Tue, Jun 17, 2008 at 16:40, William A. Rowe, Jr. <wrowe@rowe-clan.net> wrote:
>>> Candidates will be up at http://apr.apache.org/dev/dist/ once the sync
>>> happens within the hour... vote away;
>> A Cell Blade system: Linux  2.6.22-5.20070920bsc #1 SMP Tue Sep 25
>> 10:49:16 CEST 2007 ppc64 ppc64 ppc64 GNU/Linux
>>
>>
>>>  [-1] Release apr 1.3.2 as GA
>> -bash-3.2$ ./testall testlfs
>> testlfs             : |Segmentation fault
> 
> It seems that in `apr_mmap_create` on this system `mmap` returns
> MAP_FAILED == (void *)-1 but does not set `errno` to an appropriate
> value:
>    │133         mm = mmap(NULL, size, native_flags, MAP_SHARED,
> file->filedes, offset);
>    │134
>    │135         if (mm == (void *)-1) {
>    │136             /* we failed to get an mmap'd file... */
>    │137             *new = NULL;
>   >│138             return errno;
>    │139         }
> (gdb) print mm
> $2 = (void *) 0xffffffff
> (gdb) print errno
> $5 = 0

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.
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.

Regards

Rüdiger



Mime
View raw message