Crash when running ls twice #9

Open
opened 2025-12-03 09:57:14 -06:00 by pfarley · 0 comments
Owner

(Second ls is overwritten by pagefault exception)

[00000.000] [MISC] Kernel occupies this memory space: c010300e - c01276c0
[00000.000] [MISC]   -> GDT
[00000.000] [MISC] Configuring Interrupts
[00000.000] [MISC]   -> IDT
[00000.000] [MISC]       -> Setting exception vectors
[00000.000] [MISC]       -> Setting interrupt vectors
[00000.000] [MISC]       -> Disabling IRQs
[00000.000] [MISC]       -> Loading IDT
[00000.000] [MISC]       -> Remapping IRQ's
[00000.000] [MISC] Initializing memory management
[00000.000] [MISC]   -> Paging
[00000.000] [  MM]   -> Clearing page directory
[00000.000] [  MM]   -> Filling first page tables
[00000.000] [  MM]   -> Setting page directory
[00000.000] [  MM]   -> Enabling paging
[00000.000] [  MM]   -> Initializing allocation system
[00000.000] [  MM]       -> 0013F000 -> 03EC1938 (03D82938)
[00000.000] [MISC] Memory management enabled
[00000.000] [MISC]   -> STI
[00000.000] [MISC] ---------------------------------------
[00000.000] [MISC] Kernel version: 0.1.0-7303f7de*
[00000.000] [MISC] Compiled by:    GCC 14.2.0
[00000.000] [MISC] Built on:       Mar 17 2025 at 21:18:11
[00000.000] [MISC] ---------------------------------------
[00000.000] [MISC] Timer initialized
[00000.000] [PROC] Initializing multitasking
[00000.000] [PROC] sched_idle_init(): Setting up idle threads for 1 CPUs
[00000.000] [PROC] Multitasking enabled
[00000.000] [MISC] iloop()
[00000.020] [MISC] Main kernel task started
[00000.020] [MISC] Starting kernel input thread
[00000.020] [ MOD] Attempting to load module `/modules/fs.devfs.mod`
[00000.020] [ MOD] Could not access module `/modules/fs.devfs.mod`
[00000.020] [MISC] Loading init executable (/bin/linit)
[00000.020] [MISC] Creating STDIO streams
[00000.020] [MISC] Creating task
linit v0.0.1, built Mar 17 2025

#####
#######
    ####
     ####
     #####
    ### ###
   ###   ###
  ###     ###
 ###       ###
###         ###

Welcome to Lambda OS!

lshell v0.0.1, built Mar 17 2025

lshell> ls
-rwxr-xr-x 0 0 .
-rwxr-xr-x 0 0 .
-rwxr-xr-x 2 0 etc
-rwxr-xr-x 7 0 bin
[00002.520] [MISC] EXCEPTION OCCURED: Page Fault
[00002.520] [MISC] Page fault at 0x53F0010B --> 0x00000000 (non-present, read, kernel-mode)
[00002.520] [MISC]   -> EIP: C010D241 CS: 08 EFLAGS: 00010006
[00002.520] [MISC]   -> ESP: 00181FE8 DS: 181D74
[00002.520] [MISC]   -> EAX: 53F000FF EBX: 00181CF8 ECX: 00200000 EDX: 00000003
[00002.520] [MISC]   -> ESP: 00223ED8 EBP: 00223F10 EDI: 00181F4C ESI: 00181DA0
[00002.520] [MISC]   -> Page flags:  0x000
[00002.520] [MISC]   -> Table flags: 0x000
[00002.520] [MISC]   -> Page Directory: 0x001FF000
[00002.520] [MISC]   -> Kernel pagedir: 0x00121000
[00002.520] [MISC]   -> Caused by process 5 [/bin/lshell]
[00002.520] [MISC]       -> Thread 5 [/bin/lshell]
[00002.520] [MISC]       -> Entrypoint: 40000000
Stack Trace:
  [c010d241] <0x8000417c +1074827461> __x86.get_pc_thunk.di
  [c010d45e] <0x8000417c +1074828002> __x86.get_pc_thunk.di
  [c010e452] <0x8000417c +1074832086> __x86.get_pc_thunk.di
  [c0106801] <0x8000417c +1074800261> __x86.get_pc_thunk.di
  [c01057df] <0x8000417c +1074796131> __x86.get_pc_thunk.di
  [c01118a6] <0x8000417c +1074845482> __x86.get_pc_thunk.di
Stack Trace:
  [c010d241] <0x8000417c +1074827461> __x86.get_pc_thunk.di
[00002.520] [MISC] Stack contents:
<  223EC8(-4)>: [00181CF8] [00000003] [00200000] [53F000FF]
<  223ED8( 0)>: [00000000] [C010D241] [00000008] [00010006]
<  223EE8( 4)>: [00181FE8] [00181D74] [00000000] [001FEE70]
[00002.520] [MISC] Killing task

linit: login exited!
Breakpoint 1, handle_exception (exception=14 '\016', regs=..., errcode=0, iregs=...) at kernel/arch/x86/src/intr/cexceptions.c:196
196	void handle_exception(uint8_t exception, x86_pusha_regs_t regs, uint32_t errcode, x86_iret_regs_t iregs) {
(gdb) bt f
#0  handle_exception (exception=14 '\016', regs=..., errcode=0, iregs=...) at kernel/arch/x86/src/intr/cexceptions.c:196
        curr_proc = <optimized out>
#1  0xc0110c44 in exception_isr_14 ()
No symbol table info available.
#2  0x0000000e in ?? ()
No symbol table info available.
#3  0xc010d4ce in fork_clone_process (child=0x181cf8, parent=0x181b90) at kernel/src/proc/fork.c:142
        cthread = 0x181f4c
        pthread = 0x1fee70
#4  0xc010d605 in fork () at kernel/src/proc/fork.c:176
        thread = 0x1fee70
        proc = 0x181b90
        child = 0x181cf8
        cthread = 0x181f4c
#5  0xc010e602 in syscall_service (scn=21, args=0x7f000e4c) at kernel/src/proc/syscalls.c:77
        curr_thread = 0x1fee70
        func = 0xc010d510 <fork>
#6  0xc0106801 in arch_syscall_interrupt (hdlr=0xc0119a00 <_syscall_int_hdlr>) at kernel/arch/x86/src/proc/syscall.c:19
        curr_thread = 0x1fee70
        scn = <optimized out>
        args = <optimized out>
#7  0xc01057df in idt_handle_interrupt (int_n=255 '\377', pregs=..., iregs=...) at kernel/arch/x86/src/intr/idt.c:75
        i = 4
#8  0xc0111a56 in int_handler_255 ()
(Second `ls` is overwritten by pagefault exception) ``` [00000.000] [MISC] Kernel occupies this memory space: c010300e - c01276c0 [00000.000] [MISC] -> GDT [00000.000] [MISC] Configuring Interrupts [00000.000] [MISC] -> IDT [00000.000] [MISC] -> Setting exception vectors [00000.000] [MISC] -> Setting interrupt vectors [00000.000] [MISC] -> Disabling IRQs [00000.000] [MISC] -> Loading IDT [00000.000] [MISC] -> Remapping IRQ's [00000.000] [MISC] Initializing memory management [00000.000] [MISC] -> Paging [00000.000] [ MM] -> Clearing page directory [00000.000] [ MM] -> Filling first page tables [00000.000] [ MM] -> Setting page directory [00000.000] [ MM] -> Enabling paging [00000.000] [ MM] -> Initializing allocation system [00000.000] [ MM] -> 0013F000 -> 03EC1938 (03D82938) [00000.000] [MISC] Memory management enabled [00000.000] [MISC] -> STI [00000.000] [MISC] --------------------------------------- [00000.000] [MISC] Kernel version: 0.1.0-7303f7de* [00000.000] [MISC] Compiled by: GCC 14.2.0 [00000.000] [MISC] Built on: Mar 17 2025 at 21:18:11 [00000.000] [MISC] --------------------------------------- [00000.000] [MISC] Timer initialized [00000.000] [PROC] Initializing multitasking [00000.000] [PROC] sched_idle_init(): Setting up idle threads for 1 CPUs [00000.000] [PROC] Multitasking enabled [00000.000] [MISC] iloop() [00000.020] [MISC] Main kernel task started [00000.020] [MISC] Starting kernel input thread [00000.020] [ MOD] Attempting to load module `/modules/fs.devfs.mod` [00000.020] [ MOD] Could not access module `/modules/fs.devfs.mod` [00000.020] [MISC] Loading init executable (/bin/linit) [00000.020] [MISC] Creating STDIO streams [00000.020] [MISC] Creating task linit v0.0.1, built Mar 17 2025 ##### ####### #### #### ##### ### ### ### ### ### ### ### ### ### ### Welcome to Lambda OS! lshell v0.0.1, built Mar 17 2025 lshell> ls -rwxr-xr-x 0 0 . -rwxr-xr-x 0 0 . -rwxr-xr-x 2 0 etc -rwxr-xr-x 7 0 bin [00002.520] [MISC] EXCEPTION OCCURED: Page Fault [00002.520] [MISC] Page fault at 0x53F0010B --> 0x00000000 (non-present, read, kernel-mode) [00002.520] [MISC] -> EIP: C010D241 CS: 08 EFLAGS: 00010006 [00002.520] [MISC] -> ESP: 00181FE8 DS: 181D74 [00002.520] [MISC] -> EAX: 53F000FF EBX: 00181CF8 ECX: 00200000 EDX: 00000003 [00002.520] [MISC] -> ESP: 00223ED8 EBP: 00223F10 EDI: 00181F4C ESI: 00181DA0 [00002.520] [MISC] -> Page flags: 0x000 [00002.520] [MISC] -> Table flags: 0x000 [00002.520] [MISC] -> Page Directory: 0x001FF000 [00002.520] [MISC] -> Kernel pagedir: 0x00121000 [00002.520] [MISC] -> Caused by process 5 [/bin/lshell] [00002.520] [MISC] -> Thread 5 [/bin/lshell] [00002.520] [MISC] -> Entrypoint: 40000000 Stack Trace: [c010d241] <0x8000417c +1074827461> __x86.get_pc_thunk.di [c010d45e] <0x8000417c +1074828002> __x86.get_pc_thunk.di [c010e452] <0x8000417c +1074832086> __x86.get_pc_thunk.di [c0106801] <0x8000417c +1074800261> __x86.get_pc_thunk.di [c01057df] <0x8000417c +1074796131> __x86.get_pc_thunk.di [c01118a6] <0x8000417c +1074845482> __x86.get_pc_thunk.di Stack Trace: [c010d241] <0x8000417c +1074827461> __x86.get_pc_thunk.di [00002.520] [MISC] Stack contents: < 223EC8(-4)>: [00181CF8] [00000003] [00200000] [53F000FF] < 223ED8( 0)>: [00000000] [C010D241] [00000008] [00010006] < 223EE8( 4)>: [00181FE8] [00181D74] [00000000] [001FEE70] [00002.520] [MISC] Killing task linit: login exited! ``` ``` Breakpoint 1, handle_exception (exception=14 '\016', regs=..., errcode=0, iregs=...) at kernel/arch/x86/src/intr/cexceptions.c:196 196 void handle_exception(uint8_t exception, x86_pusha_regs_t regs, uint32_t errcode, x86_iret_regs_t iregs) { (gdb) bt f #0 handle_exception (exception=14 '\016', regs=..., errcode=0, iregs=...) at kernel/arch/x86/src/intr/cexceptions.c:196 curr_proc = <optimized out> #1 0xc0110c44 in exception_isr_14 () No symbol table info available. #2 0x0000000e in ?? () No symbol table info available. #3 0xc010d4ce in fork_clone_process (child=0x181cf8, parent=0x181b90) at kernel/src/proc/fork.c:142 cthread = 0x181f4c pthread = 0x1fee70 #4 0xc010d605 in fork () at kernel/src/proc/fork.c:176 thread = 0x1fee70 proc = 0x181b90 child = 0x181cf8 cthread = 0x181f4c #5 0xc010e602 in syscall_service (scn=21, args=0x7f000e4c) at kernel/src/proc/syscalls.c:77 curr_thread = 0x1fee70 func = 0xc010d510 <fork> #6 0xc0106801 in arch_syscall_interrupt (hdlr=0xc0119a00 <_syscall_int_hdlr>) at kernel/arch/x86/src/proc/syscall.c:19 curr_thread = 0x1fee70 scn = <optimized out> args = <optimized out> #7 0xc01057df in idt_handle_interrupt (int_n=255 '\377', pregs=..., iregs=...) at kernel/arch/x86/src/intr/idt.c:75 i = 4 #8 0xc0111a56 in int_handler_255 () ```
pfarley added this to the Lambda OS project 2025-12-03 09:57:14 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lambda-os/lambda-kern#9
No description provided.