[New-bugs-announce] [issue5023] Segfault in datetime.time.strftime("%z")

Eric Wald report at bugs.python.org
Wed Jan 21 17:44:45 CET 2009

New submission from Eric Wald <pythonista at brainshell.org>:

Execution of "make test" for Python 2.6.1 halts with a segmentation 
fault on line 2198 of Python-2.6.1/Lib/test/test_datetime.py; also 
occurs using the attached script, narrowing it down to the %z sequence 
in the format argument to datetime.time.strftime(), but only when the 
time object has a non-None tzinfo.  The segfault disappears when I 
comment out line 1133 of Python-2.6.1/Modules/datetimemodule.c:

PyOS_snprintf(buf, buflen, "%c%02d%s%02d", sign, hours, sep, minutes);

Compiled with GCC 3.4.3 with Smashing Stack Protector on LFS 5.1.1 
(Linux and glibc 2.3.5 with ssp patches).  Using BASECFLAGS=-
fno-stack-protector has no effect on the segfault.  All other Python 
tests pass.  HAVE_SNPRINTF has been defined to 1 in pyconfig.h by the 
config script.

I have not yet compiled gdb, but I can if requested.

components: Library (Lib)
files: zone_failure.py
messages: 80332
nosy: eswald
severity: normal
status: open
title: Segfault in datetime.time.strftime("%z")
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file12825/zone_failure.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list