Summary: | wrong timestamp value in UNIQUE_ID on mod_unique_id in Apache2.0.54 | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Kobayashi <kobayashi> |
Component: | mod_unique_id | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | FixedInTrunk, PatchAvailable |
Priority: | P2 | ||
Version: | 2.0.61 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | Linux |
This Bug still exists in 2.2.6 and 2.0.61 Timestamp wraps around in 4292 seconds, so in worst case you will get the same "unique_id" after 72 minutes. The correct handling will allow easier extraction of the timestamp and better debugging because you need to look at forensic_log only This Bug still exists in 2.2.6 and 2.0.61 Timestamp wraps around in 4292 seconds, so in worst case you will get the same "unique_id" after 72 minutes. The correct handling will allow easier extraction of the timestamp and better debugging because you need to look at forensic_log only Committed to trunk as r596448 (http://svn.apache.org/viewvc?rev=596448&view=rev). Thanks for the reminder. Please consider backporting. This is low hanging fruit. Proposed for backport to 2.2.x as r661991 (http://svn.apache.org/viewvc?view=rev&revision=661991). Backported as r662575 (http://svn.apache.org/viewvc?rev=662575&view=rev). |
Dear all, I found the value of timestamp in UNIQUE_ID is always wrong in my environment. I decoded the value and confirmed that the value was be completely different from real one, it didn't has continuousness for requested time, and it looked like random numbers. The reason comes from the difference from variable type. i.e. the variable type of unique_id_rec.stamp is a 'unsigned int' but a type of request_rec.request_time is 'apr_time_t', which is apr_int64_t. So, timestamp results in the value set mainly microsecond part. The following change will be needed to use correct timestamp. 307c307 < new_unique_id.stamp = htonl((unsigned int)r->request_time); --- > new_unique_id.stamp = htonl((unsigned int)(r- >request_time/APR_USEC_PER_SEC)); (*one line respectively*) Thank you. **FYI: 'requested_time' is set as follows --in httpd-2.0.52/srclib/apr/time/unix/time.c--- APR_DECLARE(apr_time_t) apr_time_now(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; }