Bug#1064561: 1064561 dune-grid: FTBFS on i386: 98% tests passed, 1 tests failed out of 66
Markus Blatt
markus at dr-blatt.de
Tue Feb 27 08:37:26 GMT 2024
Hi,
I did look into this shortly. I must admit that I problems seeing what could
fail in this code.
The code reads the second line of a file using using scanf and checks that the
first number read is larger or equal 2.0 and less than or equal 2.2. Strangely this works for all the other files read.
excerpt from dune/grid/io/file/gmshreader.hh
void readfile(FILE * file, int cnt, const char * format,
void* t1, void* t2 = 0, void* t3 = 0, void* t4 = 0,
void* t5 = 0, void* t6 = 0, void* t7 = 0, void* t8 = 0,
void* t9 = 0, void* t10 = 0)
{
off_t pos = ftello(file);
int c = fscanf(file, format, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
if (c != cnt)
DUNE_THROW(Dune::IOError, "Error parsing " << fileName << " "
"file pos " << pos
<< ": Expected '" << format << "', only read " << c << " entries instead of " << cnt << ".");
}
[...]
// open file name, we use C I/O
fileName = f;
FILE* file = fopen(fileName.c_str(),"rb");
if (file==0)
DUNE_THROW(Dune::IOError, "Could not open " << fileName);
//=========================================
// Header: Read vertices into vector
// Check vertices that are needed
//=========================================
number_of_real_vertices = 0;
boundary_element_count = 0;
element_count = 0;
// process header
double version_number;
int file_type, data_size;
readfile(file,1,"%s\n",buf);
if (strcmp(buf,"$MeshFormat")!=0)
DUNE_THROW(Dune::IOError, "expected $MeshFormat in first line");
readfile(file,3,"%lg %d %d\n",&version_number,&file_type,&data_size);
if( (version_number < 2.0) || (version_number > 2.2) )
DUNE_THROW(Dune::IOError, "can only read Gmsh version 2 files");
[...]
File unitcube.sh:
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
...
I will need to reproduce this somehow. Just need to learn how.
Best,
Markus
More information about the debian-science-maintainers
mailing list