
Originally Posted by
amleto
I think you should be showing the code around your exceptions, the exact error messages, and not your pro file.
When you run with a debugger, there is probably additional memory fencing, and it sounds like this is helping your bug(s) not be seen. From what you have sound, it sounds like your crash is repeatable, so that points to something that is NOT random.
Well, here's the call stack: http://nvsx.net/i/5a304.png
Code it breaks at:
Volume* SysExt = new Volume();
Volume* SysAux = new Volume();
Volume* Cache = new Volume();
Volume* Data = new Volume();
{snip}
if (DeviceStream->ReadUInt32() == Magic)
{
ValidVolumes.push_back(SysExt);
ValidVolumes.push_back(SysAux);
ValidVolumes.push_back(Cache);
ValidVolumes.push_back(Data);
}
else
{
Cache->Size = UsbSizes::CacheNoSystem;
ValidVolumes.push_back(Cache);
ValidVolumes.push_back(Data);
} // when it breaks, it breaks at this line
Volume* SysExt = new Volume();
Volume* SysAux = new Volume();
Volume* Cache = new Volume();
Volume* Data = new Volume();
{snip}
if (DeviceStream->ReadUInt32() == Magic)
{
ValidVolumes.push_back(SysExt);
ValidVolumes.push_back(SysAux);
ValidVolumes.push_back(Cache);
ValidVolumes.push_back(Data);
}
else
{
Cache->Size = UsbSizes::CacheNoSystem;
ValidVolumes.push_back(Cache);
ValidVolumes.push_back(Data);
} // when it breaks, it breaks at this line
To copy to clipboard, switch view to plain text mode
My structs:
struct Volume
{
string Name;
unsigned int Magic; // Partition magic
unsigned int SerialNumber; // Partition serial number
unsigned int SectorsPerCluster; // Number of sectors per cluster
unsigned int RootDirectoryCluster; // The cluster in which the root directory is located
UINT64 DataStart;
unsigned int Clusters; // Total number of clusters in the partition
BYTE EntrySize; // Size of a chainmap entry
UINT64 Offset; // Offset of the partition
UINT64 Size; // Size of the partition
UINT64 AllocationTableSize;
UINT64 ClusterSize;
unsigned int FatEntryShift;
Folder *Root;
};
struct Folder
{
std::vector<UINT32> ClusterChain;
Dirent Dirent;
std::vector<Folder*> CachedFolders;
std::vector<File*> CachedFiles;
bool FatxEntriesRead;
std::string FullPath;
Folder* Parent;
Volume* Volume;
};
struct File
{
std::vector<UINT32> ClusterChain;
Dirent Dirent;
std::string FullPath;
Folder* Parent;
};
struct Volume
{
string Name;
unsigned int Magic; // Partition magic
unsigned int SerialNumber; // Partition serial number
unsigned int SectorsPerCluster; // Number of sectors per cluster
unsigned int RootDirectoryCluster; // The cluster in which the root directory is located
UINT64 DataStart;
unsigned int Clusters; // Total number of clusters in the partition
BYTE EntrySize; // Size of a chainmap entry
UINT64 Offset; // Offset of the partition
UINT64 Size; // Size of the partition
UINT64 AllocationTableSize;
UINT64 ClusterSize;
unsigned int FatEntryShift;
Folder *Root;
};
struct Folder
{
std::vector<UINT32> ClusterChain;
Dirent Dirent;
std::vector<Folder*> CachedFolders;
std::vector<File*> CachedFiles;
bool FatxEntriesRead;
std::string FullPath;
Folder* Parent;
Volume* Volume;
};
struct File
{
std::vector<UINT32> ClusterChain;
Dirent Dirent;
std::string FullPath;
Folder* Parent;
};
To copy to clipboard, switch view to plain text mode
Edit: forgot about the exception
(ad4.c50): Access violation - code c0000005 (first chance)
s
sException at 0x77da2073, code: 0xc0000005: write access violation at: 0x1, flags=0x0 in ntdll!RtlpLowFragHeapFree
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=27a83a05 ebx=0e1c0f1b ecx=0b081bff edx=00000b08 esi=017adf8e edi=0e1c0000
eip=77da2073 esp=0012cc28 ebp=0012cc5c iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206
ntdll!RtlpLowFragHeapFree+0xc5:
77da2073 8930 mov dword ptr [eax],esi ds:0023:27a83a05=????????
Bookmarks