Opened 12 years ago
Closed 10 years ago
#9489 closed bug (fixed)
Divide Error Exception - GPT Partition Table Driver
Reported by: | kallisti5 | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Partitioning Systems/GPT | Version: | R1/Development |
Keywords: | Cc: | kevinjamesfield@…, Jens.Arm@… | |
Blocked By: | Blocking: | #9603, #10009, #10376 | |
Platform: | All |
Description
Insert a usb stick which used to have a gpt map on it... random kdl's.
Seems likely related to #3064 (looks like the same error on the Intel partition system driver)
Screenshot attached
Attachments (2)
Change History (15)
by , 12 years ago
Attachment: | IMG_20130301_103347.jpg added |
---|
comment:1 by , 12 years ago
Blocking: | 9603 added |
---|
comment:2 by , 12 years ago
I don't have yet a working Haiku system, but this one should be easy to fix in src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp:
static float efi_gpt_identify_partition(int fd, partition_data* partition, void** _cookie) { + if (partition->block_size == 0) + return -1; + EFI::Header* header = new (std::nothrow) EFI::Header(fd, (partition->size - 1) / partition->block_size, partition->block_size); status_t status = header->InitCheck(); if (status != B_OK) { delete header; return -1; }
Could some of you guys check it for me? Thanks.
comment:3 by , 12 years ago
A better fix will to pass the whole partition_data to Header constructor and move the check in InitCheck(), though.
follow-up: 5 comment:4 by , 12 years ago
I don't think the VFS should even call that method with an invalid partition. It's error prone to have these kinds of checks in every file and partitioning system.
follow-up: 6 comment:5 by , 12 years ago
Replying to axeld:
I don't think the VFS should even call that method with an invalid partition. It's error prone to have these kinds of checks in every file and partitioning system.
Somehow agree. Problem is where having a 0 block_size geometry should be considering an error and avoid rescanning partitions? KDiskDeviceManager::_CheckMediaStatus() ? KDiskDeviceManager::_ScanPartitions() ? partition system modules ?
Plus, are all partition systems necessary block-based? The DDM is pretty agnostic here, letting the partition modules use the device geometry information or not...
Due to the risk that any unchecked division in kernel space pose, I'm inclined to prefer paying the price of multiple checks than the one we pay right now, a KDL.
comment:6 by , 12 years ago
Replying to phoudoin:
Due to the risk that any unchecked division in kernel space pose, I'm inclined to prefer paying the price of multiple checks than the one we pay right now, a KDL.
This would be nice place for an assert check (and fixing the code that calls it to not call it with a 0 set.)
comment:7 by , 12 years ago
Cc: | added |
---|
comment:8 by , 11 years ago
I have the same problem, but I have it on boot time and no usb keys nor hard disks mapped as gpt my mobo is an Asus M5A97 R2.0 with uefi.
comment:9 by , 11 years ago
I forgot to say that if I boot Haiku from cd-r drive the error won't happen and it boots flawlessy. I can even install it on hard drive, but if I reboot from the fresh installation it does the same error. I post the related screenshots
by , 11 years ago
Attachment: | DSCN0454.JPG added |
---|
comment:10 by , 11 years ago
Blocking: | 10009 added |
---|
comment:11 by , 11 years ago
Blocking: | 10376 added |
---|
comment:12 by , 11 years ago
Cc: | added |
---|
I get this exception only if "Eject when unmounting" in mount options is enabled.
(In #9603) ah. This is a 100% duplicate of my issue :D
#9489 shows an identical error