2

On windows 10 I have a Oracle VM VirtualBox running with Ubuntu 20.04.5 and sometimes an application (started with sudo) just "hangs". I am not able to kill the job using

kill -9 <process_id>

because this kill process will also hang.

Is there any other way to stop such a process without force-stopping the VM?

Output from ps -ef:

root        3207    3166  0 10:26 pts/1    00:00:00 sudo ./isp_cli 79 sjb50_bootloader_secondary_v0.1.0m_kja
root        3208    3207  0 10:26 pts/1    00:00:00 ./isp_cli 79 sjb50_bootloader_secondary_v0.1.0m_kjar_190

The command ps -Al shows

4 S     0    1811    1714  0  80   0 -  5142 -      pts/0    00:00:00 sudo
4 D     0    1812    1811  0  80   0 -  1634 -      pts/0    00:00:00 isp_cli

It is an application to communicate via USB <-> CAN with some hardware device. And for some testing (interrupting some communication process) it will always fail running a second time. And it becomes quite cumbersome to restart the VM in each of these cases.

I also tried to use

sudo pkill -9 -f isp_cli
sudo killall -9 isp_cli
sudo kill -hup 1811
sudo kill -15 1811

but these commands also were unable to stop the actual blocking process, and hang as well.

I further tried to get some more information about the process, but even if I try

sudo cat /proc/1916/stack

this also hangs. No output, no return to the terminal.

17
  • 1
    Any process waiting in device will usually be unkillable. This is a poor question though as you are giving us no info on which process is failing. Do not drip feed info. Commented Jan 17, 2023 at 10:12
  • What additional information do you need?
    – Alex
    Commented Jan 17, 2023 at 10:15
  • 2
    How about output from ps, how about which devices are connected and what are expected to be connected. How about what the process is actually trying to achieve. How about info on the host as to whether it is using network shares. Commented Jan 17, 2023 at 10:19
  • 1
    We are talking about not being able to kill it from within the vm, not killing it by bringing the vm down. Commented Jan 17, 2023 at 11:09
  • 2
    @Alex stopping the VM is like pulling the plug of a real PC. (Depending on how exactly you do this.)
    – Bodo
    Commented Jan 17, 2023 at 12:24

1 Answer 1

0

The D status means that the process is in Uninterruptible sleep and this name really does mean what it says.

You might try the solution from the post unkillable/unstoppable normal user process, how to forcedly control it?
I reproduce below the answer by Aquarius Power.

I can avoid rebooting using the commands below:

sudo cgcreate -g cpu:/cpulimited
sudo cgclassify -g cpu:cpulimited 2315444 #the `find` pid
cd /sys/fs/cgroup/cpu/cpulimited
echo 1000000 |sudo tee cpu.cfs_period_us
echo 1000 |sudo tee cpu.cfs_quota_us #cant be less than 1000 as I tested

read the full explanation for cpu.cfs_quota_us at here, from this tip

The cgroup magic works on such unkillable process!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .