WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Closing SSH session with tce-ab open uses 99% CPU.  (Read 3829 times)

Offline code

  • Newbie
  • *
  • Posts: 22
Closing SSH session with tce-ab open uses 99% CPU.
« on: August 25, 2017, 09:27:59 AM »
If you SSH into TinyCore and then run tce-ab and then press enter ~ . to close the SSH session, tce-ab will have init as a parent and use 100% CPU.

If you do it again the two will each use 50% of the CPU.


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Closing SSH session with tce-ab open uses 99% CPU.
« Reply #1 on: August 25, 2017, 02:05:35 PM »
I don't think this is a bug. When a parent (shell in this case) dies, there is no signal sent to its children. Any other program, not just tce-ab, would continue running and get reparented to init.

If you close the shell like that, forcing it instead of a normal logout/exit, you should expect such from all programs.
The only barriers that can stop you are the ones you create yourself.

Offline code

  • Newbie
  • *
  • Posts: 22
Re: Closing SSH session with tce-ab open uses 99% CPU.
« Reply #2 on: August 25, 2017, 03:55:47 PM »
Okay.

Any idea why it starts to use 100% CPU though? Normally it uses 0% CPU.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Closing SSH session with tce-ab open uses 99% CPU.
« Reply #3 on: August 26, 2017, 03:30:13 AM »
It runs a read loop, and read returns immediately if the pty disappears, I believe.
The only barriers that can stop you are the ones you create yourself.

Offline neonix

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 401
Re: Closing SSH session with tce-ab open uses 99% CPU.
« Reply #4 on: March 08, 2019, 01:37:58 AM »
I have the same problem but without SSH, in normal desktop.

When I type (using aterm)
Code: [Select]
tce
s
mc (for example)
q
i
Now, I have to press q to quit the program in correct way, but instead of this I close aterm and tce still run in background and consume all CPU power in 1 of my 2 cores. In the past I was not aware of that and my system slow down without a reason. I had to check what's going on using top command.

This bug occur in many versions of TC for years. Maybe there is simply workaround that kill the process if it's not closed properly?