Opened 2 months ago

Closed 4 weeks ago

#394 closed defect - etc (fixed)

check_data() may use uninitialized variable

Reported by: peter Owned by: nobody
Priority: minor Milestone: c17.01 release
Component: infrastructure Version: trunk
Keywords: Cc:


The routine check_data() suppresses cautions about md5sum mismatches when the NO TIME command is in effect. Hence it reads the variable prt.lgPrintTime. This variable is first set in the routine InitDefaultsPreparse(). The problem is that by then some data files have already been read and check_data() will have read the "uninitialized" version of prt.lgPrintTime (actually since the data is global, it will have been set to zero / false by default which is the wrong initialization).

There are two solutions.

1) give t_prt a ctor that sets lgPrintTime. This guarantees consistent behavior when the NO TIME command is not in effect, but not when the NO TIME command is used. The latter is a problem because some files are read before the parsing starts, leading to inconsistent behavior of check_data() before and after parsing.

2) revert the change to check_data() and give a caution despite the NO TIME command. This way check_data() no longer needs to access prt.lgPrintTime. However, this will lead to more frequent breaking of the repeatability tests whenever a datafile on a release branch has been updated without updating the md5sum file.

I am not sure yet which is the better solution...

Change History (1)

comment:1 Changed 4 weeks ago by peter

Resolution: fixed
Status: newclosed

Solution 1 was chosen, with the additional change that the NO TIME command is now picked up in "preparsing" in cdDrive(), making it far less likely that a data file is read before this command is picked up.

Fixed on the trunk in r11806/7, and r11808 on c17_branch.

Note: See TracTickets for help on using tickets.