Closed Lubrsi closed 3 years ago
Hm can you resolve the stack trace to file/line information? I'm particularly interested in where in Kernel/init.cpp this happens.
Note that this is on latest master and that I've flipped it upside down:
[#0 Kernel]: 0xc0100356 (next: 0x403e8a10)
Kernel/Arch/x86/common/Boot/boot.S:565
[#0 Kernel]: 0xc0e7124f (next: 0xc0120ff8)
Kernel/init.cpp:153
[#0 Kernel]: 0xc0e47f2e (next: 0xc0120fa8)
Kernel/Time/TimeManagement.cpp:138
AK/Singleton.h:107
AK/Singleton.h:76
AK/Singleton.h:46
Kernel/Arch/x86/ScopedCritical.h:20
[#0 Kernel]: 0xc0c2a78b (next: 0xc0120f58)
Kernel/Arch/x86/common/CPU.cpp:23
[#0 Kernel]: 0xc0c2a924 (next: 0xc0120f28)
Kernel/Arch/x86/common/CPU.cpp:31
Hm can you throw a VERIFY_NOT_REACHED();
into TimeManagement::the()
and see where in Kernel/init.cpp that is? Looks like something is calling it before TimeManagement::initialize(0)
in this particular setup.
[Kernel]: ASSERTION FAILED: false
[Kernel]: ../../Kernel/Time/TimeManagement.cpp:136 in static void Kernel::TimeManagement::initialize(u32)
(upside down)
[#0 Kernel]: 0xc0100356 (next: 0x403e8a10)
Kernel/Arch/x86/common/Boot/boot.S:565
[#0 Kernel]: 0xc0e7072d (next: 0xc0120ff8)
Kernel/init.cpp:153
[#0 Kernel]: 0xc0e3ce55 (next: 0xc0120fa8)
??:? (Trying 0xc0e3ce54 gives Kernel/Time/TimeManagement.cpp:136)
[#0 Kernel]: 0xc0c2a78b (next: 0xc0120f88)
Kernel/Arch/x86/common/CPU.cpp:23
[#0 Kernel]: 0xc0c2a924 (next: 0xc0120f58)
Kernel/Arch/x86/common/CPU.cpp:31
I think I see what's happening. Note this line and how it's before the assertion failure:
[Kernel]: KernelRng: Using HPET as entropy source
To do that, it's doing this: https://github.com/SerenityOS/serenity/blob/552185066ed836eef38f1f9088c9482854dcf70a/Kernel/Random.cpp#L51-L53
That call to the()
creates an instance if it doesn't already exist.
Maybe add a call to TimeManagement::initialized()
or turn TimeManagement::can_query_precise_time
into a static method that also returns false
if not initialized.
This reproduces in Bochs FWIW
I'm seeing this in QEMU as well. Similar result passing -no-hpet flag to qemu. Log attached. serenity_TMassert-nohpet.txt
Anyone figure this out? having the same error, it gets stuck at booting from rom for me. this is using qemu, this is the error I got.
[Kernel]: CPU[0]: No RDRAND support detected, randomness will be poor [Kernel]: CPU[0]: Physical address bit width: 36 [#0 Kernel]: Initializing unhandled interrupt handlers [Kernel]: CPU[0]: CPUID hypervisor signature 'KVMKVMKVM' (0x4b4d564b 0x564b4d56 0x4d), max leaf 0x40000001 [Kernel]: Kernel Commandline: Kernel/Kernel hello [Kernel]: MM: Multiboot mmap: address=0x00000000, length=654336, type=1 [Kernel]: MM: Got an unaligned physical_region from the bootloader; correcting length 654336 by 3072 bytes [Kernel]: MM: Multiboot mmap: address=0x0009fc00, length=1024, type=2 [Kernel]: MM: Multiboot mmap: address=0x000f0000, length=65536, type=2 [Kernel]: MM: Multiboot mmap: address=0x00100000, length=535691264, type=1 [Kernel]: MM: Multiboot mmap: address=0x1ffe0000, length=131072, type=2 [Kernel]: MM: Multiboot mmap: address=0xfeffc000, length=16384, type=2 [Kernel]: MM: Multiboot mmap: address=0xfffc0000, length=262144, type=2 [Kernel]: MM: Contiguous reserved range from P000000000009fc00, length is 394240 [Kernel]: MM: Contiguous reserved range from P000000001ffe0000, length is 3758227456 [Kernel]: MM: boot_pdpt @ P0000000000101000 [Kernel]: MM: boot_pd0 @ P0000000000102000 [Kernel]: MM: boot_pd3 @ P0000000000103000 [Kernel]: MM: Physical page entries: 0xc2001000 - 0xc2801fff (size 0x00801000) [Kernel]: MM: Low memory range @ P0000000000000000 - P00000000000fffff (size 0x100000) [Kernel]: MM: Kernel range @ P0000000000100000 - P0000000001206fff (size 0x1107000) [Kernel]: MM: Physical Pages range @ P0000000001208000 - P0000000001a0dfff (size 0x806000) [Kernel]: MM: Super physical region: P0000000000122000 - P0000000000221fff (size 0x100000) [Kernel]: 1x PhysicalZone (1 MiB) @ 0000000000122000-0000000000121fff [Kernel]: MM: User physical region: P0000000001a0e000 - P000000001ffdffff (size 0x1e5d2000) [Kernel]: 30x PhysicalZone (16 MiB) @ 0000000001a0e000-000000001ea0dfff [Kernel]: * 5x PhysicalZone (1 MiB) @ 000000001fa0e000-000000001fe0dfff [#0 Kernel]: Early access to ACPI tables for interrupt setup [Kernel]: Interrupts: Switch to Legacy PIC mode [Kernel]: PIC: Cascading mode, vectors 0x50-0x5f [#0 Kernel]: Trying to unregister unused handler (?) [#0 Kernel]: Trying to unregister unused handler (?) [#0 Kernel]: Interrupts: Detected Dual i8259 [Kernel]: ACPI: Using RSDP @ P00000000000f5a60 [Kernel]: ACPI: Main Description Table valid? true [Kernel]: ACPI: Using RSDT, enumerating tables @ P000000001ffe2b7b [Kernel]: ACPI: RSDT revision 1, total length: 52 [Kernel]: ACPI: Initializing Fixed ACPI data [Kernel]: ACPI: Searching for the Fixed ACPI Data Table [Kernel]: ACPI: Fixed ACPI data, Revision 1, length: 116 bytes [Kernel]: ACPI: DSDT P000000001ffe0040 [Kernel]: ACPI: Dynamic Parsing Enabled, Can parse AML [Kernel]: RTC: Year: 2021, month: 7, day: 16, hour: 6, minute: 57, second: 16 [Kernel]: HPET @ P000000001ffe2b1b [Kernel]: HPET: Minimum clock tick - 0 [Kernel]: HPET: Timers count - 3 [Kernel]: HPET: Main counter size: 64-bit [Kernel]: HPET: Timer[0] comparator size: 64-bit, mode: 64-bit [Kernel]: HPET: Timer[1] comparator size: 64-bit, mode: 64-bit [Kernel]: HPET: Timer[2] comparator size: 64-bit, mode: 64-bit [Kernel]: HPET: frequency 100000000 Hz (100 MHz) resolution: 10 ns [#0 Kernel]: Trying to unregister unused handler (?) [#0 Kernel]: Trying to unregister unused handler (?) [#0 Kernel]: HPET: Setting appropriate functions to timers. [#0 Kernel]: Time: Scanning for periodic timers [#0 Kernel]: Time: Scanning for non-periodic timers [Kernel]: KernelRng: Using HPET as entropy source [Kernel]: ASSERTION FAILED: !s_the.is_initialized() [Kernel]: ../../Kernel/Time/TimeManagement.cpp:137 in static void Kernel::TimeManagement::initialize(u32) [#0 Kernel]: 0xc072b06d abort +0x17e [#0 Kernel]: 0xc072aecf _abort +0x0 [#0 Kernel]: 0xc0840e24 Kernel::TimeManagement::initialize(unsigned int) +0x1b6 [#0 Kernel]: 0xc0852371 init +0x2bf [#0 Kernel]: 0xc0100356 pae_supported +0x146
edit: posted error
This reproduces in Bochs FWIW
I'm able to reproduce this by just running the kernel from the terminal like this:
qemu-system-i386 -kernel Kernel/Kernel -m 512 -device isa-debugcon,chardev=stdout -chardev stdio,id=stdout,mux=on
CPU: AMD A4-3400 APU with Radeon(tm) HD Graphics Motherboard: ASUS F1A55-M LX
Bisect points to 6938be00f1c2c87a83a173cca0c8a7c78ac88a94 cc @tomuta
Log:
Ubuntu dmesg and lspci: dmesg.txt