[Box Backup] VSS on x64 not working with x86 binaries

Achim J. Latz achim+box at qustodium.net
Thu Feb 26 01:02:17 GMT 2015


Hello list:

This message/task has stared me in the eye for the last 950 days, but 
today I finally reply :-D

On 20/07/2012 23:38, Chris Wilson wrote:
> Sorry, I wasn't aware of the compile problems until now. I think I've
> just checked in the necessary fixes. Please could you update and try again?

Good news everyone: after a few hours of fighting with the build 
environment, the code and the dependencies, I just managed to compile a 
native x64 version under Windows 2012, and it works just fine, including 
VSS snapshots (still to be confirmed: potential data loss because of 
int/long mismatch, see below).

The following three code changes are necessary, at least according to my 
notes:

1) lib/backupstore/HousekeepStoreAccount.cpp

// otherwise StringCchCatA is not found, but perhaps we don't use it 
anymore?
#ifdef WIN32
	#include <Strsafe.h>
#endif


2) lib/backupstore/BackupStoreRefCountDatabase.cpp

// to prevent error C2589: '(' : illegal token on right side of '::'
// at line 349:
// ObjectID < std::max(MaxOldObjectId, MaxNewObjectId);
//
// Alternative: change std::max to max like so:
//			ObjectID < max(MaxOldObjectId, MaxNewObjectId) ;

#ifdef WIN32
	#define NOMINMAX
#endif

3) I also applied this patch, although I didn't try without it, so it 
might not be necessary
<http://lists.boxbackup.org/pipermail/boxbackup-dev/attachments/20131004/d3501d10/attachment.obj>

Index: lib/backupstore/BackupStoreCheck.cpp
===================================================================
--- lib/backupstore/BackupStoreCheck.cpp	(revision 3200)
+++ lib/backupstore/BackupStoreCheck.cpp	(working copy)
@@ -553,8 +553,8 @@
  				(mFixErrors?rFilename:""));
  			if(mFixErrors)
  			{
-				RaidFileWrite write(mDiscSetNumber, rFilename);
-				write.TransformToRaidStorage();
+				RaidFileWrite rfwrite(mDiscSetNumber, rFilename);
+				rfwrite.TransformToRaidStorage();
  			}
  		}
  		else if(existance == RaidFileUtil::AsRaidWithMissingReadable)
@@ -564,14 +564,14 @@
  				(mFixErrors?rFilename:""));
  			if(mFixErrors)
  			{
-				std::auto_ptr<RaidFileRead> read(
+				std::auto_ptr<RaidFileRead> rfread(
  					RaidFileRead::Open(mDiscSetNumber,
  						rFilename));
-				RaidFileWrite write(mDiscSetNumber, rFilename);
-				write.Open(true /* overwrite */);
-				read->CopyStreamTo(write);
-				read.reset();
-				write.Commit(true /* transform to RAID */);
+				RaidFileWrite rfwrite(mDiscSetNumber, rFilename);
+				rfwrite.Open(true /* overwrite */);
+				rfread->CopyStreamTo(rfwrite);
+				rfread.reset();
+				rfwrite.Commit(true /* transform to RAID */);
  			}
  		}
  	}


Is there a way to please reflect those changes in the code base?


In addition, I believe now would be an excellent time to discuss/address 
Charles' comments re: 64bit:

On 24/10/2011 16:42, Charles Lecklider wrote:
> There are lots of problems compiling trunk for Windows x64, many of
> which can cause data loss. The root cause of almost all of the problems
> is that sizeof(int) == sizeof(long) == 4 on both Windows x86 and x64,
> but BB assumes that sizeof(long) == 8 (and in places int too) for x64.

Source: 
<http://lists.boxbackup.org/pipermail/boxbackup/2011-October/006233.html>

Best regards, Achim



More information about the Boxbackup mailing list