#1672 closed bug (fixed)
Bootmenu triggers reboot
Reported by: | marcusoverhagen | Owned by: | axeld |
---|---|---|---|
Priority: | blocker | Milestone: | R1/alpha1 |
Component: | System/Boot Loader | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Entering the Haiku bootmenu triggers a reboot after leaving it. On my machine this has always been reproducible.
I've tracked down an access to a destroyed Partition object by the boot loader in src/system/boot/loader/loader.cpp
load_modules(stage2_args *args, Directory *volume) does
// iterate over the mounted volumes and load their file system Partition *partition; if (gRoot->GetPartitionFor(volume, &partition) == B_OK) { while (partition != NULL) { load_module(volume, partition->ModuleName()); partition = partition->Parent(); } }
This partition pointer gets invalid and triggers a reboot, because Parent() does return an object that has been destroyed before the boot menu was shown. Thus the object has been overwritten by the boot menu code.
This can be seen in haikupartitions2.txt, the pointer is 0x0010971c
This problem doesn't seem to happen at all when not entering the bootmenu, see haikupartitions1.txt for reference.
Attachments (2)
Change History (7)
by , 17 years ago
Attachment: | haikupartitions1.txt added |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Yes this fixes the problem.
However, I'm not sure if this code in partitions.cpp is save:
// move the partitions containing file systems to the partition // list fChildren.Remove(child); gPartitions.Add(child);
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks for the update! The list iterator is safe to be used in this context, and the parent pointer is not affected by this code.
normal boot without bootmenu