Tiny Core Base > TCB Bugs

[Solved] tce hangs in background and hogs the cpu (TCL13 Pure64)


I run TCL13 Pure64 on my X230 laptop. I do no use the  Apps  GUI--whenever I want to search or install extensions, I use  tce  at the command line.

Often, after using  tce  to browse the repo (I don't even have to install anything), my laptop's fans will turn on. Whenever this happens, running  top  shows me that  tce  is running in the background and consuming about 25% of my CPU (see attached).

Is this a known issue with tce?

I figured it out. The culprit is this line at the beginning of /usr/bin/tce:

--- Code: ---trap 'echo && exit 1 1>&2' 1 2 15

--- End code ---

If for any reason the terminal in which  tce  is running is closed, then the  tce  script receives SIGHUP (signal 1). The problem is that once the terminal is closed, the  echo  command fails because there is no stdout connected to the script. Script seems to enter an endless loop, driving CPU usage way up.

Fix is to simply change the line above to this, which allows the script to exit when it receives SIGHUP, regardless of whether  echo  succeeds or not:

--- Code: ---trap 'echo; exit 1 1>&2' 1 2 15

--- End code ---

I will submit a pull request on Github. Issue is solved.

Merged, thanks.


[0] Message Index

Go to full version