[Gluster-users] Segfault in gluster volume heal

Brian Candler B.Candler at pobox.com
Sat Jul 14 19:26:51 UTC 2012


On Sat, Jul 14, 2012 at 08:14:51PM +0100, Brian Candler wrote:
> I see a dubious bit of code there:
> 
>         uint32_t        time = 0;
> ...
>                         tm = localtime ((time_t*)(&time));
> 
> That should be (IMO):
> 
>         time_t          time = 0;
> ...
>                         tm = localtime (&time);
> 
> In particular, on a 64-bit platform, time_t is almost certainly not a 32-bit
> quantity.

This appears to have been mostly fixed in commit
5672e77d3102a990a2aa11e7e56ebfe6a0eee369

I see that cli/src/cli-rpc-ops.c still has one instance of
uint32_t        time = 0;
however now it's passed to dict_get_uint32(), not to localtime().

I'm not sure what this is doing. It still seems a bit dubious to be using
uint32 for anything time-related (and definitely will be a problem in 2038!)

I see also ./xlators/features/marker/src/marker.h has
        uint32_t        timebuf[2];
but I have not traced through what it's doing with this.

Regards,

Brian.



More information about the Gluster-users mailing list