gvmap opens a debugging file to write timing information to if verbosity is
enabled. It tried to unconditionally close this file, regardless of whether
verbosity was enabled. The result was that, without verbosity enabled, it would
call fclose(NULL). The effect of this seems to vary across operating systems but
can result in a crash. This fix only tries to close the file if it was
previously opened. Related to #1822.
Unfortunately we cannot un-xfail test_gvmap_fclose because it fails for another
reason on some platforms.
characters
- out of bounds read when examining a registered plugin whose name is ≥63
characters
+- do not `fclose(NULL)` in gvmap
## [2.47.2] - 2021-05-26
fprintf(fp,"%f %f %f\n", (real) (clock() - start)/(CLOCKS_PER_SEC), norm1[0], norm1[2]);
}
}
- fclose(fp);
+ if (fp != NULL) {
+ fclose(fp);
+ }
}
static void country_graph_coloring_internal(int seed, SparseMatrix A, int **p, real *norm_1, int do_swapping){
assert srcs1 == srcs2, \
"mismatch between sources in {str(vcxproj)} and {str(filters)}"
-@pytest.mark.xfail()
+@pytest.mark.xfail() # FIXME: fails on CentOS 7/8, macOS Autotools, MSBuild
@pytest.mark.skipif(shutil.which("gvmap") is None, reason="gvmap not available")
def test_gvmap_fclose():
"""