Subject: | ParseDate never returns for certain inputs |
Date: | Tue, 7 Jul 2015 20:40:28 +0000 |
To: | "bug-Date-Manip [...] rt.cpan.org" <bug-Date-Manip [...] rt.cpan.org> |
From: | Jared Selengut <Jared.Selengut [...] xls.xerox.com> |
Hello,
My apologies if this bug is fixed in a more recent release, but I found an issue today with Date::Manip where it runs indefinitely and uses up all memory for certain inputs to ParseDate. If a numeric string of at least 18 digits is passed, it never returns and starts using unlimited memory at the rate of about 2GB per minute. Please see sample code below. Note that a string of all zeros does not cause a problem, and a string beginning with a minus sign may not either.
use strict;
use warnings;
use Date::Manip;
ParseDate('0' x 18); # no problem
ParseDate('a' x 18); # no problem
ParseDate('1' x 17); # runs for 12 seconds and uses several hundred MB
ParseDate('1' x 18); # runs until the system locks up from lack of memory
# perl, v5.10.0 built for x86_64-linux-thread-multi
# Linux 2.6.27.48-0.6-default x86_64
# Date::Manip 6.24
Jared Selengut
Complex Analytics
Xerox Litigation Services
80 State St., Suite 300
Albany, NY 12207
p 518.434-6543 x-1961
i 8*328-1961
m 518.382.7607
www.xerox-xls.com<http://www.xerox-xls.com/>