[Python-bugs-list] [Bug #110700] strftime crashes with invalid args (PR#183)

noreply@sourceforge.net noreply@sourceforge.net
Sun, 6 Aug 2000 09:42:24 -0700


Bug #110700, was updated on 2000-Jul-31 14:29
Here is a current snapshot of the bug.

Project: Python
Category: None
Status: Closed
Resolution: Wont Fix
Bug Group: Platform-specific
Priority: 5
Summary: strftime crashes with invalid args (PR#183)

Details: Jitterbug-Id: 183
Submitted-By: calvin@cs.uni-sb.de
Date: Thu, 13 Jan 2000 11:00:38 -0500 (EST)
Version: 1.5.2
OS: Linux (Debian slink)


test.py:
import time
# crash it by swapping year and month argument
print time.strftime("%d.%m.%Y %H:%M:%S", (1,2000, 1, 0, 0, 0, 0, 1, 0))

python test.py
Segmentation fault

Well there were similar crashes with time.strptime calls. I think this
is a platform bug with the C function strftime, but I did not test this
in a C program.


====================================================================
Audit trail:
Thu Jan 13 11:04:15 2000	guido	changed notes
Thu Jan 13 11:04:16 2000	guido	moved from incoming to platformbug

Follow-Ups:

Date: 2000-Aug-01 14:03
By: none

Comment:
From: Guido van Rossum <guido@CNRI.Reston.VA.US>
Subject: Re: [Python-bugs-list] strftime crashes with invalid args (PR#183)
Date: Thu, 13 Jan 2000 11:03:50 -0500

> Full_Name: Bastian Kleineidam
> Version: 1.5.2
> OS: Linux (Debian slink)
> Submission from: www-proxy.rz.uni-sb.de (134.96.7.81)
> 
> 
> test.py:
> import time
> # crash it by swapping year and month argument
> print time.strftime("%d.%m.%Y %H:%M:%S", (1,2000, 1, 0, 0, 0, 0, 1, 0))
> 
> python test.py
> Segmentation fault
> 
> Well there were similar crashes with time.strptime calls. I think this
> is a platform bug with the C function strftime, but I did not test this
> in a C program.

Yes, this is a platform bug.  Please report it to the C library folks
(sorry, I can't do that for you).

--Guido van Rossum (home page: http://www.python.org/~guido/)

-------------------------------------------------------

Date: 2000-Aug-01 14:03
By: none

Comment:
From: Bastian Kleineidam <calvin@void.cs.uni-sb.de>
Subject: Re: [Python-bugs-list] strftime crashes with invalid args (PR#183)
Date: Thu, 13 Jan 2000 18:37:14 +0100 (CET)


[snip bug report]
:) Yes, this is a platform bug.  Please report it to the C library folks
:) (sorry, I can't do that for you).
Ok, did it.
So the safe side is to check the arguments before calling time.strftime()

Bastian Kleineidam



-------------------------------------------------------

Date: 2000-Aug-01 14:03
By: none

Comment:
From: Bastian Kleineidam <calvin@cs.uni-sb.de>
Subject: Re: [Python-bugs-list] strftime crashes with invalid args (PR#183)
Date: Thu, 13 Jan 2000 19:39:52 +0100 (CET)


:) Yes, this is a platform bug.  Please report it to the C library folks
:) (sorry, I can't do that for you).
I got answer from Andreas Jaeger that this bug is fixed with the current
glibc version 2.1.2.

Bastian Kleineidam


-------------------------------------------------------

Date: 2000-Aug-01 14:03
By: none

Comment:
The Linux C library code has a long way to go...

-------------------------------------------------------

Date: 2000-Aug-06 09:42
By: twouters

Comment:
Caused by a (by now fixed) bug in GNU libc, not one in Python, therefor closed the bug report.


-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110700&group_id=5470