darshan-hpc / darshan

Darshan I/O characterization tool
Other
55 stars 27 forks source link

BUG: fix darshan-runtime config parsing leading to infinite loops #988

Open shanedsnyder opened 2 months ago

shanedsnyder commented 2 months ago

Various Darshan config variables take a CSV of regexes as input (e.g. APP_EXCLUDE, NAME_EXCLUDE). Darshan's code for iterating and parsing these regexes can cause an infinite loop if one of the regexes is unable to be compiled. E.g.,

NAME_EXCLUDE    *    POSIX

The 2nd field is the regex CSV (in this case just a single regex), but * is not a valid regex (it is a special character indicating that the preceding character(s) are repeated one or more times, but there are no preceding characters above) and causes an error when compiling the regex. This input causes Darshan to continuously output the following warning:

darshan library warning: unable to compile Darshan config NAME_EXCLUDE regex *

This PR fixes the bug causing the Darshan library to continuously parse the same erroneous token rather than printing a warning once and advancing.