Ticket #2471: MAX_<subsys>_LOG does not properly handle values >= 2GB

Internal MaxLog[] values are currently declared as off_t, which correctly allows for file sizes of > 2GB on systems that support it. However, the config values are currently translated using atoi(), which overflows if you try to give it a value >= 2GB.

atoi() needs to be replaced with a function capable of handling 8-byte off_t implementations.

[Append remarks]

Remarks:

2011-Sep-16 12:29:06 by cweiss:
You can probably save time on discussion if ticket #823 is considered related.


2011-Sep-16 18:14:19 by eje:
REPRO/TEST:

Use the following config to set a value for MAX_SCHEDD_LOG that is slightly larger than 2GB:

# 2^31 + 1000
MAX_SCHEDD_LOG = 2147484648

Before fix: If you start up the schedd, you should almost immediately see the SchedLog roll over, and a goofy value for MaxLog:

$ tail SchedLog.old
09/16/11 10:09:25 (pid:16467) MaxLog = -2147482648, length = 167
09/16/11 10:09:25 (pid:16467) Saving log file to "/usr/local/condor/local/log/SchedLog.old"

To test the fix, pre-set SchedLog at just under 2GB:

[condor@rorschach log]$ rm SchedLog
[condor@rorschach log]$ dd if=/dev/zero of=SchedLog bs=1024 count=1 seek=2097150

After fix, you should (again, immediately) see the SchedLog roll over properly at a value slightly larger than MAX_SCHEDD_LOG:

$ tail SchedLog.old
09/16/11 16:00:29 (pid:3761) MaxLog = 2147484648, length = 2147484710
09/16/11 16:00:29 (pid:3761) Saving log file to "/usr/local/condor/local/log/SchedLog.old"


2011-Sep-29 14:15:33 by jfrey:
This patch looks good to me.
[Append remarks]

Properties:

Type: defect           Last Change: 2011-Sep-29 14:43
Status: resolved          Created: 2011-Sep-16 12:18
Fixed Version: v070604           Broken Version:  
Priority:          Subsystem: Daemons 
Assigned To: eje           Derived From:  
Creator: eje  Rust:  
Customer Group: other  Visibility: public 
Notify: tstclair@redhat.com, jthomas@redhat.com, eje@cs.wisc.edu  Due Date:  

Derived Tickets:

#2836   RFE: Gracefully handle MAX_..._LOG configuration errors

Related Check-ins:

2011-Oct-20 15:26   Check-in [27930]: Fixing check for parsing errors in lex_cast<> for yet a 3rd time ===GT=== #2471 (By Erik Erlandson )
2011-Oct-20 15:03   Check-in [27927]: Fixing check for parsing errors in lex_cast<> for yet a 3rd time ===GT=== #2471 (By Erik Erlandson )
2011-Oct-05 14:30   Check-in [27636]: Altered test for parsing success in lex_cast<>() to use eof() instead of tellg(), which does not have a portable integer-value semantic ===GT=== #2471 (By Erik Erlandson )
2011-Oct-03 14:37   Check-in [27605]: We write full sentences for version history items, and include enough info such that they can be understood without looking at the ticket. Corrected LaTeX usage. ===GT=== #2471 (By Karen Miller )
2011-Sep-29 16:56   Check-in [27485]: Fixed error from my forward merge from 7.6 for #2471 (By Erik Erlandson )
2011-Sep-29 14:39   Check-in [27474]: Merged [27468], [27472], [27473], Merge V7_6-branch to V7_7_2-branch ===GT=== #2471 (By Erik Erlandson )
2011-Sep-29 14:33   Check-in [27473]: ===VersionHistory:Completed=== ===GT=== #2471 (By Erik Erlandson )
2011-Sep-29 14:27   Check-in [27472]: Improved parsing of integer values to support MAX_<SUBSYS>_LOG >= 2GB. ===GT:Fixed=== #2471 (By Erik Erlandson )
2011-Sep-27 14:56   Check-in [27507]: Handled by eje, pending review of #2471 Revert "MAX_NUM_..._LOG now uses param_integer instead of param+atoi" This reverts commit 278cac86865b17319f7d689274f4ad2e0a8de81e. (By Matthew Farrellee )
2011-Sep-27 14:55   Check-in [27506]: Handled by eje, pending review of #2471 Revert "MAX_..._LOG now uses param_integer instead of param+atoi" This reverts commit f39311dfa7325e2dc514edc35d08ba03975421a5. (By Matthew Farrellee )

Attachments: