Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: segfault in strftime



Sebastian Stark wrote:
> I just found that zsh segfaults when I do this:
> 
>  zmodload zsh/datetime
>  strftime "%a %d.%m.%Y %H:%M:%S" 67768036191673200
> 
> while it doesn't for smaller numbers, like:
> 
>  strftime "%a %d.%m.%Y %H:%M:%S" 67768036191673199
> 
> It will print a negative year for this value though. Negative results are n=
> ot a big problem I think, but a segfault could be.
> 
> I tried this with zsh-4.3.10 under linux-gnu-x86_64. Can anyone reproduce t=
> his?

I don't see where that would cause a problem, so I'd be interested in a
backtrace---the only place I can see it going wrong is within strtoul().
I'll have a go under that configuration when I get home, but I didn't
get it with a quick go on a 64-bit machine here; I get an ERANGE
everywhere, which means the strtoul() returned an error.  If it didn't,
we got an unsigned long which we converted to time_t, and there's not a
lot left to go wrong.

(I'm not really interested in anyone else's reports unless they can shed
more light on it.)

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author