PatchMixolydic / spinel

An operating system built to explore systems programming
MIT License
4 stars 1 forks source link

printf can cause triple fault #10

Closed PatchMixolydic closed 4 years ago

PatchMixolydic commented 4 years ago

Seems to be reproducible with __asm__("int $0"); (this does sometimes happen even with printf outside of an interrupt/panic):

The system is coming up.
panic: Division by zero
eax: 0x19    ebx: 0x1262B0    ecx: 0xC0105A18    edx: 0x3D5
esp: 0xC010DFF8    ebp: 0xC010E030    esi: 0x[triple fault]
01114356756e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x0e) [page fault]
01114356756e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x08) [double fault]
<bochs:3> info idt 0xe 0x8
Interrupt Descriptor Table (base=0x00000000c010e120, limit=2047):
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e160
error: IDTR+8*8 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e168
error: IDTR+8*9 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e170
error: IDTR+8*10 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e178
error: IDTR+8*11 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e180
error: IDTR+8*12 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e188
error: IDTR+8*13 points to invalid linear address 0x00000000c010e120
bx_dbg_read_linear: physical address not available for linear 0x00000000c010e190
error: IDTR+8*14 points to invalid linear address 0x00000000c010e120

It looks like the page tables are being corrupted

PatchMixolydic commented 4 years ago

Bisected to afe4309.

PatchMixolydic commented 4 years ago

Seems to be a bug in itoa