Menu

#945 Matchbox keyboard causes 100% pcmanfm CPU usage

1.2
open
pcmanfm (136)
7
2019-08-12
2015-03-26
Dan
No

Launching the matchbox on-screen keyboard causes pcmanfm 1.2.3-1+raspi to go to 100% CPU usage. The 100% CPU usage continues even if matchbox is closed. This behavior doesn't seem to occur with pcmanfm 0.9.10-3.

On the latest Raspbian image (February 16, 2015), launching the Matchbox on-screen keyboard causes the file manager (pcmanfm) to use up all available CPU usage. The CPU usage does not return to normal even if Matchbox is closed. The 100% CPU usage only occurs when pcmanfm is run in desktop mode (either on initial Raspbian launch, or with the command 'sudo pcmanfm --desktop'). It does not occur when pcmanfm is launched in a window (like when 'File Manager' is launched from the 'Accessories' menu). This behavior does not occur with the September 9, 2014 Raspbian image.

Steps to reproduce

  1. Image Raspbian (September 9, 2014) to a SD card and enable 'Boot to desktop'
  2. Install Matchbox keyboard with 'sudo apt-get install matchbox'
  3. Launch Matchbox from the 'Keyboard' applet in the 'Accessories' folder
  4. CPU usage indicator in the taskbar goes to 100%
  5. Close Matchbox on-screen keyboard --> CPU usage remains at 100%

Optional

  1. Open a terminal window and execute 'top' to see that 'pcmanfm' has taken all available CPU
  2. Kill 'pcmanfm' with 'sudo kill -9 [pcmanfm PID]' --> CPU usage drops to 0%
  3. Launch 'pcmanfm' in desktop mode by typing in the terminal 'sudo pcmanfm --desktop'
  4. Launch Matchbox from the 'Keyboard' applet in the 'Accessories' folder --> CPU usage goes to 100%
  5. Kill 'pcmanfm' with 'sudo kill -9 [pcmanfm PID]' --> CPU usage drops to 0%
  6. Launch 'File Manager' from the 'Accessories' menu
  7. Launch Matchbox from the 'Keyboard' applet in the 'Accessories' folder --> CPU usage remains at 0%

Discussion

1 2 > >> (Page 1 of 2)
  • Dan

    Dan - 2015-03-26

    Sorry, there was an error in the above "Steps to reproduce" - In step 1, it should be the current Raspbian image, not the September 9th, 2014 image.

     
  • Dan

    Dan - 2015-03-26

    Info for the working (September 9th, 2014) image (No 100% CPU usage after Matchbox)

    pcmanfm version: 0.9.10

    OS Version: Linux raspberrypi 3.18.10+ #774 PREEMPT Wed Mar 25 13:58:34 GMT 2015 armv6l GNU/Linux ["Raspbian GNU/Linux 7 (wheezy)"]

     
  • Lonely Stranger

    Lonely Stranger - 2015-03-26
    • assigned_to: Lonely Stranger
    • Priority: 5 --> 7
     
  • Lonely Stranger

    Lonely Stranger - 2015-03-26

    If you start desktop support as user root then your application tries to own the desktop then it might be some conflict. Unfortunately I cannot test it since I don't know what matchbox does exactly and how to reproduce it. I would like you to try start pcmanfm in standard mode (without any sudo) and report, please, if it behaves the same way or your issue doesn't happen.

    Unfortunately ancient version 0.9.10 (which was deprecated and unsupported since 2012) cannot be compared with current one due to too many changes since then, and therefore any issue should be investigated from scratch. And I might need your help with debug since I cannot test it myself (strictly speaking, I have 1st version of Raspberry Pi board somewhere but I'm not sure if I can reproduce your environment as I don't have any touchscreen that may be connected to it).

    Thank you very much.

     
  • Lonely Stranger

    Lonely Stranger - 2015-05-19
    • status: open --> pending
     
  • Dan

    Dan - 2015-05-19

    Hi, sorry I missed the notification for your previous question. The default user on Raspian is 'pi', not 'root' so I don't believe that can be the cause.

    I will test 'pcmanfm --desktop' (without the sudo) soon, and get back to you with the results.

     
  • Dan

    Dan - 2015-05-19

    For your other question, Matchbox is an on-screen virtual keyboard as is used with touchscreens and tablets. It also works with a mouse. A touchscreen is not required.

     

    Last edit: Dan 2015-05-19
  • Lonely Stranger

    Lonely Stranger - 2015-05-20
    • status: pending --> open
     
  • Lonely Stranger

    Lonely Stranger - 2015-05-20

    Thank you very much. If you think it can be reproducible without touchscreen then may be I'll try it when time permits. I'm not sure though if it can run on my Pi (it's version 1 B board, not even B+) but I give it a shot, I didn't tried to use it for awhile.

     
  • Dan

    Dan - 2015-05-20

    Model B is fine. Should be pretty easy to reproduce:

    1. Download latest Raspbian image from: http://downloads.raspberrypi.org/raspbian_latest
    2. Install Matchbox on-screen keyboard with 'sudo apt-get install matchbox'
    3. Launch Matchbox from the 'Keyboard' applet in the 'Accessories' folder
     
  • Dan

    Dan - 2015-05-23

    Here are the results:

    'pcmanfm --desktop' --> CPU usage goes to 100% when Matchbox keyboard is launched

    'sudo pcmanfm --desktop' --> CPU usage goes to 100% when Matchbox keyboard is launched

    'pcmanfm' --> CPU usage stays at 0% when Matchbox keyboard is launched

    'sudo pcmanfm' --> CPU usage stays at 0% when Matchbox keyboard is launched

     

    Last edit: Dan 2015-05-23
  • Lonely Stranger

    Lonely Stranger - 2015-06-16

    Unfortunately I could not find a source of that 100% CPU usage, trying gdb it shows stack is corrupted when I break execution, and even setting breakpoints in the pcmanfm code doesn't help, it doesn't stop on any. And BTW, the same matchbox with the same pcmanfm never has that problem on PC, only on Raspberry Pi. I'm afraid there is some XOrg problem on Raspberri Pi which causes this, I also got it to 100% when tried to configure panel keyboard switcher - the setxkbmap ate all the CPU, even mouse cursor was not much responsible so I had to kill panel from console (Ctrl+Alt+F1 then login) to be able to access terminal window. I'll test it again when time permits.

     
  • Dan

    Dan - 2015-06-16

    Thanks for looking into this! Very strange about the stack corruption. Is it possible to debug it by going the reverse way (i.e. setting breakpoints in the Matchbox code and stepping through it to see which line causes the problem)? Perhaps that would give a hint about where the problem lies in PCManFM (if in fact the problem is in PCManFM and not somewhere else)?

     
  • Dan

    Dan - 2015-06-16

    Also, is it possible that the 100% CPU usage is causing the debugger problems (i.e. Would it help to set the PCManFM thread priority very low, so that it is not able to hog the CPU and "starve" gdb of CPU time)? Or is it not possible for that to be the cause?

     
  • Lonely Stranger

    Lonely Stranger - 2015-06-17

    I'm sorry, you probably don't know how debugger works. It does not run in any thread or in background, it just adds some code over a running application so it can be stopped and debugger get control to inspect application current state, only debugger or application may run at the same time, not both. And if debugger shows stack corrupted then either application is really messed up, or debugger works incorrectly in that architecture. I need some more tests to decide is it former or latter case.

    And I'm afraid it's really impossible to trace matchbox events to find a hint, I need to learn all details of matchbox code to do that, it's too much work with too low chance to get any help, I'm sorry.

     
  • Rob G

    Rob G - 2016-01-19

    I have the same problem. Did you find any workaround to this?

     
  • Michael

    Michael - 2016-05-17

    I have the same problem (100% CPU usage) on a RaspberryPI model A (with latest raspian).

     
  • Chris Martinus

    Chris Martinus - 2016-09-30

    Same symptoms here. Did an apt-get upgrade yesterday and after running matchbox, pcmanfm sucks up all the CPU cycles, even after a soft reboot. Cycling power fixes it until the next time matchbox runs.

    I launch matchbox from a script. The code segment looks like this:

    matchbox-keyboard&
    zenity --username --password
    killall matchbox-keyboard

    This pops up a keyboard for a dialog when necessary and then goes away again. Crude, but it worked well and still works fine with Ubuntu on a PC.

     

    Last edit: Chris Martinus 2016-09-30
  • Justinas Grigas

    Justinas Grigas - 2016-10-19

    There is a simple solution using python

    import os
    os.system("matchbox-keyboard")
    quit()

    This wil keep your CPU normal

     
  • Lonely Stranger

    Lonely Stranger - 2016-12-09

    There is a chance this issue is caused by the same as [#1028] which is now fixed in the GIT repository sources. Test it when possible, please, and report back whether it's fixed too or not. Thank you very much.

     

    Related

    Bugs: #1028

  • Lonely Stranger

    Lonely Stranger - 2016-12-09
    • labels: matchbox --> pcmanfm
     
  • Galen W Rosenberg

    Nope it's stil broken. Cpu usage spikes to 100 and then settles at 25. Stays there until rebooting.

     
  • slajerek

    slajerek - 2017-07-04

    I confirm this 2017/07/04 is still broken on my pi from apt-get.

    matchbox-keyboard 0.1
    Copyright (C) 2007 OpenedHand Ltd.

     

    Last edit: slajerek 2017-07-04
  • fierman b

    fierman b - 2017-07-26

    'metoo' - matchbox in raspbian repos needs to be updated:
    matchbox-keyboard-im 0.1+svn20080916-10 armhf

    raspbian 8.0 on pi3

     
  • Anonymous

    Anonymous - 2018-01-18

    Same problem here. 100% CPU after boot RPi + immediately launching matchbox-keyboard. From "ps ax" I see "pcmanfm --desktop --profile LXDE-pi". "kill -9 pid" on pnmanfm restarts the process and fixes the CPU. Closing the on-screen keyboard does nothing to reduce CPU. This is a new RPi 3 B fresh out of the box and patched

    uname -a: Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

     
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel