Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 17717
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: vitaly.tomilin [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.08
Fixed in: (no value)



Subject: strftime causes coredump on OpenBSD 3.8-i386
Matt, For instance script as simple as perl -MTime::Piece -e 'print localtime->strftime' Segmentation fault (core dumped) would produce a perl.core on my two systems. The 1.09 version is also affected. Perl version is 5.8.6. Time permitting I will try to fix this myself and share a patch. Sincerely, Vitaly Tomilin
From: vitaly.tomilin [...] gmail.com
I have already sent a patch for this to Matt, however he's probably too busy at the moment to take care of it. Thus, I am posting the patch here, accompanied with build instructions. Please note that it hasn't been tested on platforms other than OpenBSD 3.8 and Linux 2.4 & 2.6, both i386 architecture. To apply obtain and extract the Time::Piece v1.09(http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/Time-Piece-1.09.tar.gz). Then go to Time-Piece-1.09 directory, copy patch file there and apply it: patch <patch For more information visit my blog at http://vargenborg.blogspot.com ===== patch begins: start setection below this line ===== --- /tmp/Time-Piece-1.09/Piece.xs 2005-11-15 17:46:23.000000000 -0500 +++ Piece.xs 2006-02-17 22:23:28.000000000 -0500 @@ -23,7 +23,7 @@ * support is added and NETaa14816 is considered in full. * It does not address tzname aspects of NETaa14816. */ -#ifdef HAS_GNULIBC +#if !defined(HAS_GNULIBC) # ifndef STRUCT_TM_HASZONE # define STRUCT_TM_HASZONE # else @@ -816,6 +816,7 @@ char tmpbuf[128]; struct tm mytm; int len; + memset(&mytm, 0, sizeof(mytm)); my_init_tm(&mytm); /* XXX workaround - see my_init_tm() above */ mytm.tm_sec = sec; mytm.tm_min = min; ====patch ends: finish selection above this line ==== /VT
On Fri Feb 24 14:25:12 2006, guest wrote: Show quoted text
> I have already sent a patch for this to Matt, however he's probably > too > busy at the moment to take care of it. Thus, I am posting the patch > here, accompanied with build instructions. Please note that it hasn't > been tested on platforms other than OpenBSD 3.8 and Linux 2.4 & 2.6, > both i386 architecture. To apply obtain and extract the Time::Piece > v1.09(http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/Time- > Piece-1.09.tar.gz). > Then go to Time-Piece-1.09 directory, copy patch file there and apply > it: > > > patch <patch > > For more information visit my blog at http://vargenborg.blogspot.com > > ===== patch begins: start setection below this line ===== > --- /tmp/Time-Piece-1.09/Piece.xs 2005-11-15 17:46:23.000000000 > -0500 > +++ Piece.xs 2006-02-17 22:23:28.000000000 -0500 > @@ -23,7 +23,7 @@ > * support is added and NETaa14816 is considered in full. > * It does not address tzname aspects of NETaa14816. > */ > -#ifdef HAS_GNULIBC > +#if !defined(HAS_GNULIBC) > # ifndef STRUCT_TM_HASZONE > # define STRUCT_TM_HASZONE > # else > @@ -816,6 +816,7 @@ > char tmpbuf[128]; > struct tm mytm; > int len; > + memset(&mytm, 0, sizeof(mytm)); > my_init_tm(&mytm); /* XXX workaround - see my_init_tm() > above */ > mytm.tm_sec = sec; > mytm.tm_min = min; > ====patch ends: finish selection above this line ==== > > /VT
Applied. Thanks.