[haiku-development] Re: Help needed for input_server debug and tracker crash

  • From: Michael Lotz <mmlr@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 20 Jul 2020 22:55:54 +0200

On 20.07.20 21:18, Adrien Destugues wrote:

With these changes applied:
- Tracker crashes on boot

Tracker crashes because get_key_map() returns NULL/NULL in src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp:125 which it uses via libshortcuts_shared. A NULL check should be added here. The reason get_key_map() returns NULL is that "_control_input_server_" in src/kits/interface/Input.cpp times out talking to the input_server.

- input_server does not seem to work

It does work eventually, but it blocks because it tries to talk to itself while it is not yet set up. The calls to retrieve the current settings in initialization of MouseSettings by the input_server via MouseSettings::_RetrieveSettings() in src/preferences/input/MouseSettings.cpp will eventually call _control_input_server_, trying to send a message to itself. Once all of these have timed out, things return to normal.

- Overall the system seems very slow (the debug window draws its border
   and the content only appears a few seconds later, I shut down the
   system from the power button on my machine and the shutdown process
   was also quite slow)

This is due to everything trying to retrieve infos from the input_server via _control_input_server_ and having to time out.

This makes the thing a bit difficult to debug, since no interaction with
the machine seems possible. Any suggestion on how to investigate such
problems? Is KDL the only way?

I debugged this inside QEMU. With "-serial stdio" you can see the serial debug output on the console. From there the stack trace of the crash is visible, which pretty quickly leads to the problematic call from Tracker.

To figure out what input_server is up to, KDL is indeed the simplest IMHO. KDL is a pretty nice place overall and allows to easily find where things currently are. In this particular case things are made a bit more complicated since the usual key combination for entering KDL is not available as the input_server has not yet brought up the keyboard (I'd usually use the QEMU monitor with "sendkey alt-sysrq-d"). In this instance I've provoked a KDL by triggering a machine check exception (from the QMEU monitor with "mce 0 0 0xff00000000000000 0 0 0"), but this only works due to a pending patch on my side to enable MCEs.

With serial debug output available, adding some debug_printfs inside the input_server startup would probably have lead to the problem reasonably quickly as well.

Regards,
Michael

Other related posts: