PatchMixolydic/spinel

printf can cause triple fault

Closed this issue · 2 comments

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

Bisected to afe4309.

Seems to be a bug in itoa