Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: segfault in strftime
- X-seq: zsh-users 14895
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: segfault in strftime
- Date: Fri, 26 Feb 2010 13:03:28 +0000
- In-reply-to: <A73C7D9C-66C5-4BFA-8FB3-8560FE65B529@xxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <A73C7D9C-66C5-4BFA-8FB3-8560FE65B529@xxxxxxxxxxx>
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