Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 95558 - glibc-2.3.4.20041102-r1: mktime fails to normalize the tm structure when tm_sec is out of range
Summary: glibc-2.3.4.20041102-r1: mktime fails to normalize the tm structure when tm_s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-09 07:14 UTC by Laurent Pinchart
Modified: 2005-07-22 14:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Test program (mktime.c,584 bytes, text/plain)
2005-06-09 07:15 UTC, Laurent Pinchart
Details
Proposed patch - From the glibc CVS repository (glibc-2.3.4-fix-mktime.patch,347 bytes, patch)
2005-06-09 07:16 UTC, Laurent Pinchart
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Pinchart 2005-06-09 07:14:10 UTC
from man mktime:   
   
"If structure members are outside their legal interval, they will be   
normalized (so that, e.g., 40 October is changed into 9 November)."   
   
mktime fails to normalize the tm_sec member. It clamps its value to [0..59]   
instead. This causes problems in all programs that rely on that functionality, 
for instance to convert time between local time and UTC. KOrganizer is one 
such program. 
 

Reproducible: Always
Steps to Reproduce:
1. Emerge glibc-2.3.4.20041102-r1 
2. Run the attached test program 
Actual Results:  
tut: 1104534060, stm: 2005-01-01 00:00:59 0001 

Expected Results:  
tut: 1104534060, stm: 2005-01-01 00:01:00 0001
Comment 1 Laurent Pinchart 2005-06-09 07:15:00 UTC
Created attachment 60906 [details]
Test program
Comment 2 Laurent Pinchart 2005-06-09 07:16:06 UTC
Created attachment 60907 [details, diff]
Proposed patch - From the glibc CVS repository
Comment 3 SpanKY gentoo-dev 2005-07-22 14:51:08 UTC
this is in glibc-2.3.5, thanks