Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#604 closed defect (notadefect)

System sometimes appears wedged under msim

Reported by: Jakub Jermář Owned by: Martin Decky
Priority: major Milestone: 0.7.0
Component: helenos/kernel/mips32 Version: mainline
Keywords: msim, keyboard Cc:
Blocker for: Depends on:
See also:

Description

The latest mainline (r2266) HelenOS/mips32/msim will appear hung, especially after a longer period of inactivity or when we change focus of the terminal window, but a closer look will reveal that it is only the keyboard input that for some reason does not pass through as it should.

You can try to boot (try to give the system 64M instead of 32M), then let HelenOS rest for some time and see if it appears hung (does not react to keyboard input). If it is still alive, try issuing a couple of commands and switch to some other window on your desktop and then back to the terminal window with msim.

If you indeed manage to hang the system, you will be able to set a breakpoint on exc_dispatch() and see that the kernel is still ticking, only the keyboard interrupts are not processed for some reason.

When the system appears hung, the kernel is executing the WAIT instruction in scheduler_separated_stack(), which suggests waiting for an interrupt event.

Attachments (1)

stdby-patch (480 bytes ) - added by Jakub Jermář 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Martin Decky, 9 years ago

Milestone: 0.6.00.7.0

comment:2 by Jakub Jermář, 9 years ago

The problem seems to be that upon decoding the WAIT instruction, msim sets the program counter to point to the WAIT instruction again and waits for an exception to happen. When an exception occurs, it runs the exception handler (that's why the Count and Compare registers appear to tick) and then resumes execution of the interrupted context, only to return to executing the WAIT instruction again. So the instruction following WAIT is never reached. I am going to attach a simple fix which fixed this for me.

by Jakub Jermář, 9 years ago

Attachment: stdby-patch added

comment:3 by Jakub Jermář, 9 years ago

Resolution: notadefect
Status: newclosed

Closing as not a defect [of HelenOS, but a defect of MSIM].

comment:4 by Martin Decky, 8 years ago

FYI: The fix of MSIM is finally upstream as release 1.3.8.5 in the stable branch. The mainline branch now also implements the WAIT instruction.

Note: See TracTickets for help on using tickets.