Ticket #394 (new defect - etc)

Opened 5 weeks ago

check_data() may use uninitialized variable

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

Description

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...

Note: See TracTickets for help on using tickets.