[vtkusers] Debug Assertion Fails in vtkTecplotReader

AF falahatpisheh at gmail.com
Sun Feb 5 12:46:15 EST 2012


Hi all,

I am trying to read 10,000 Tecplot ASCII files by using *vtkTecplotReader*.
It is strange that I get the following error when the number of read files
reaches 508. It does not matter in what order I read 10,000 files. The file
number 508 has no problem because if I start reading the files from file
number 500, the error will happen on file number 500+508! I am using
Microsoft Visual Studio 2008 in Windows 7 64 bit.
*
Debug Assertion Failed!
Expression: (stream != NULL) in fread.c*

I tracked the error and it happens in the function bool
FileStreamReader::open( const char* fileName ) in vtkTecplotReader.cxx:

*FILE *ff = fopen(fileName,"rb");
fread(magic,1,2,ff);
fclose(ff);*

The pointer ff gets *NULL *and I think it causes the error "/Debug Assertion
Fails/".

I would be very grateful if somebody can help me.

// this function is called 1000 time and the error occurs when ifile == 508.
int file_reader( int ifile )
 {	
	string fullpath_filename;	
	ostringstream strout(fullpath_filename);

        // this for-loop in the actual code is done 10 times. For debug
purposes it is looped only once.
	for ( int i = 0 ; i < 1 ; i++){ 
		vtkSmartPointer<vtkTecplotReader> reader = 
								vtkSmartPointer<vtkTecplotReader>::New();
                // filelist is global and can be accessed here.
		strout <<	"d:\\ << filename_prefix_veloc <<
					setw( 6 ) << 
					setfill( '0' ) << 
					filelist[iframe] << 
					".dat";
		fullpath_vel_filename = strout.str();	
                reader->SetFileName(fullpath_filename.c_str());		
		reader->Update(); // this is the line where the error occurs when ifile ==
508.
	}

	return 0;
 }
falahatpisheh at gmail.com
Ahmad

--
View this message in context: http://vtk.1045678.n5.nabble.com/Debug-Assertion-Fails-in-vtkTecplotReader-tp5458290p5458290.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list