EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Office 2010 crashing on VDisk sample application

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#17772
Posted: 10/07/2011 02:17:10
by Sam G (Basic support level)
Joined: 10/07/2011
Posts: 2

Hello,

I've downloaded, compiled and run the C++ version of VDisk in Visual Studio 2010. Explorer browses the directories in the filesystem that I mounted with VDisk (Z:) with no issues, and Notepad is successful in creating and saving files.

However, if I try to save a file from Word 2010 (same behavior in Excel 2010), I get an ASSERT failure saying that position + bytestoread > allocationsize (usually on the temporary file). This results in Word crashing in such a hard way that I must restart the computer to close it. I've tried to debug with not much success yet - is anyone able to reproduce this?

Also on the note of crashing, it is unfortunate that Word cannot exit gracefully in the event of an ASSERT failure in the VDisk code... is this normal? It's making development/debugging quite difficult. I tried setting the timeout to 10s but Word still insists on hard crashing. Z: is then left behind as a zombie drive and generally I have to restart my whole computer. Is there something I can do to make recovering from an ASSERT failure more graceful?

I am running CBFS 3.2.98. Thanks!
#17775
Posted: 10/07/2011 05:54:18
by Vladimir Cherniga (EldoS Corp.)

Hello,
try to rewrite the next code in VirtualFile::Read() method

ASSERT((Position + BytesToRead) <= mAllocationSize);

with next

if (Position) >= mEndOfFile)
throw(ECBFSError(ERROR_HANDLE_EOF));

PS: fixed code
#17776
Posted: 10/07/2011 06:18:21
by Volodymyr Zinin (EldoS Corp.)

There is an error in the sample's code. Instead of:

Code
VOID VirtualFile::set_AllocationSize(__int64 Value)
{
    if(mAllocationSize > Value) {

        mStream = realloc(mStream, (size_t)Value);
        if(Value > 0) {
            ASSERT(mStream);
        }
        mAllocationSize = Value;
    }
}


should be:
Code
VOID VirtualFile::set_AllocationSize(__int64 Value)
{
    if(mAllocationSize < Value) {
....
}
#17777
Posted: 10/07/2011 06:53:15
by Sam G (Basic support level)
Joined: 10/07/2011
Posts: 2

@Vladimir Zinin, Thank you, that fix worked perfectly.

@Vladimir Cherniga, Before I fixed the code, I added your exception code (instead of the ASSERT) to see if the failure would be more graceful, but it wasn't - Word still crashed extremely hard and Z: was left as a zombie. This means that, during development, any time my code has an unrecoverable exception, I basically have to restart my computer. When you guys develop with CBFS, do you deal with the same thing? Or are you somehow recovering such that Windows is not hosed each time the CBFS app code fails without the ability to recover? How are you able to develop efficiently? Please let me know. Thanks!
#17778
Posted: 10/07/2011 07:14:10
by Vladimir Cherniga (EldoS Corp.)

It can be rewritten as the following code also

VOID VirtualFile::set_AllocationSize(__int64 Value)
{
if(mAllocationSize != Value) {
....
}

And use this method in VirtualFile::Write() instead of set_iAllocationSize()
#17779
Posted: 10/07/2011 07:25:01
by Vladimir Cherniga (EldoS Corp.)

Quote
When you guys develop with CBFS, do you deal with the same thing?


I can advise to use virtual machine to simplify the code debugging. Using VMware or VirtualBox you may attach debugger remotely, and with system snapshots development becomes faster.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 1162 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!