Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash: Wrong kind of BTree header #29

Open
tomkoen opened this issue Jun 9, 2015 · 6 comments
Open

crash: Wrong kind of BTree header #29

tomkoen opened this issue Jun 9, 2015 · 6 comments
Assignees

Comments

@tomkoen
Copy link
Contributor

tomkoen commented Jun 9, 2015

Just have encounted a DMG file (Apple Service Diagnostic 3S135.dmg, 3.55 GB) that throws this type of exception (in HFSBTree::HFSBTree) when constructing HFSExtentsOverflowBTree
After this, the app crashes in CachedReader::nonCachedRead
throw std::logic_error("Range returned by adviseOptimalBlock() is too large");

@tomkoen tomkoen changed the title io_error: Wrong kind of BTree header crash: Wrong kind of BTree header Jun 9, 2015
@tomkoen
Copy link
Contributor Author

tomkoen commented Jun 9, 2015

@LubosD
Copy link
Member

LubosD commented Jun 10, 2015

I can confirm the issue with adviseOptimalBlock(), but I haven't yet seen the HFSExtentsOverflowBTree problem.

@LubosD LubosD self-assigned this Jun 10, 2015
LubosD added a commit that referenced this issue Jun 10, 2015
@tomkoen
Copy link
Contributor Author

tomkoen commented Jun 10, 2015

I can confirm that
std::logic_error("Range returned by adviseOptimalBlock() is too large"); is fixed, thanks!
but "Wrong kind of BTree header" can be reproduced in this way (sorry not to mention it earlier):

// if (DMGDisk::isDMG(g_fileReader)) // if we skip DMG check
//      g_partitions.reset(new DMGDisk(g_fileReader));
//  else 
if (GPTDisk::isGPTDisk(g_fileReader))
        g_partitions.reset(new GPTDisk(g_fileReader));
    else if (AppleDisk::isAppleDisk(g_fileReader))
        g_partitions.reset(new AppleDisk(g_fileReader));
    else if (HFSVolume::isHFSPlus(g_fileReader)) // this is TRUE!
        volume.reset(new HFSVolume(g_fileReader)); // here is exception
    else
        throw function_not_implemented_error("Unsupported file format");

It might not be an error I understand

@LubosD
Copy link
Member

LubosD commented Jun 10, 2015

Is is an error, which would normally prevent the image from being mounted on Linux, but it just doesn't happen here. I'll download the file again from your DropBox, maybe it's different?

@tomkoen
Copy link
Contributor Author

tomkoen commented Jun 10, 2015

Sorry but it doesn't happen when trying to mount the file as DMG.
For some reason HFSVolume::isHFSPlus gives true for this file and then

volume.reset(new HFSVolume(g_fileReader));

gives exception

@LubosD
Copy link
Member

LubosD commented Jun 10, 2015

Ah, I see. I'll take a look into that. But given that the .DMG file is itself RAW (=no compression used), it is entirely possible it may get misdetected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants