T3D 1.1 Betas Engine crashes when calculating the CRC of an empty file /w Fix - LOGGED
by Thomas · in Torque 3D Professional · 10/07/2010 (9:32 am) · 3 replies
Build: 1.1 Beta 2 & 3
Target: Script Console
Issues: When calculating a CRC of an empty file, Torque crashes.
Steps to Repeat:
0. Create a simple e.g. test.cs
1. Launch the game
2. Open Console
3. type getFileCRC( "test.cs" );
4. ...
Suggested Fix: For People with code access
alter winVolume.cpp line 362
without code access check the filesize before calculating the CRC, with
Target: Script Console
Issues: When calculating a CRC of an empty file, Torque crashes.
Steps to Repeat:
0. Create a simple e.g. test.cs
1. Launch the game
2. Open Console
3. type getFileCRC( "test.cs" );
4. ...
Suggested Fix: For People with code access
alter winVolume.cpp line 362
U64 fileSize = getSize();
if( !fileSize ) // Added
return 0; // Addedwithout code access check the filesize before calculating the CRC, with
if( fileSize( "test.cs" ) != -1 )
getFileCRC( "test.cs" );
//else
// CRC is 0! About the author
A guy from a farm, milking cows and driving tractors... Otherwise I run in burning houses and save some furniture lives...
#2
I've been unable to reproduce this one. How are you creating the test file you're using, is it via a specific program or just via explorer? Are there any errors in the console log when you get this crash?
11/08/2010 (7:31 pm)
@ThomasI've been unable to reproduce this one. How are you creating the test file you're using, is it via a specific program or just via explorer? Are there any errors in the console log when you get this crash?
#3
I've just read an file from original torque system. It's odd, I had the crash in Beta2, looking in the code, it's easy:
Ok, Memory handler behaves like intented, but that's not the aim of the CRC calculation, isn't it? Or isn't CRC calculation of an empty file allowed?
11/09/2010 (5:36 am)
Hi Scott,I've just read an file from original torque system. It's odd, I had the crash in Beta2, looking in the code, it's easy:
FrameTemp<U8> buf( fileSize );is defined in
FrameTemp( const U32 count = 1 ) : mNumObjectsInMemory( count )
{
AssertFatal( count > 0, "Allocating a FrameTemp with less than one instance" );
...with an empty file this stops me out. Ok, Memory handler behaves like intented, but that's not the aim of the CRC calculation, isn't it? Or isn't CRC calculation of an empty file allowed?
Associate David Montgomery-Blake
David MontgomeryBlake