Hi there,
i've a problem with cpulimit.
Example Usage:
./cpulimit -l 10 echo "Hello World"
Result: cpulimit hangs
After a friendly STRG c i got the following result:
zsh: segmentation fault ./cpulimit -l 10 echo "Hello World"
Usage with verbose mode:
./cpulimit -v -l 10 echo "Hello World"
Result:
8 cpu detected
Running command: 'echo Hello World'
Limiting process 6578
Warning: Cannot change priority. Run as root or renice for best results.
Members in the process group owned by 6578: 1
%CPU work quantum sleep quantum active rate
Hello World
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
0.00% 100000 us 0 us 100.00%
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
0.00% 100000 us 0 us 100.00%
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Process 6578 dead!
Endless output.
I think that is not the expected behavior.
The cpulimt version is the actual master branch.
git rev-parse HEAD
d7373dde5dde22945524d09e2c3f7f1a8290c6b9
Could that be the solution?
diff --git a/src/cpulimit.c b/src/cpulimit.c
index 5353b90..92ab156 100644
--- a/src/cpulimit.c
+++ b/src/cpulimit.c
@@ -231,7 +231,8 @@ void limit_process(pid_t pid, double limit, int include_children)
if (kill(proc->pid,SIGCONT)!=0) {
//process is dead, remove it from family
if (verbose) fprintf(stderr, "Process %d dead!\n", proc->pid);
- //remove_process_from_family(&pf, proc->pid);
+ delete_node(pgroup.proclist, node);
+ destroy_node(pgroup.proclist, node);
}
}
@@ -254,7 +255,8 @@ void limit_process(pid_t pid, double limit, int include_children)
if (kill(proc->pid,SIGSTOP)!=0) {
//process is dead, remove it from family
if (verbose) fprintf(stderr,"Process %d dead!\n", proc->pid);
- //remove_process_from_family(&pf, proc->pid);
+ delete_node(pgroup.proclist, node);
+ destroy_node(pgroup.proclist, node);
}
}
//now the processes are sleeping
Hi there,
i've a problem with cpulimit.
Example Usage:
Result: cpulimit hangs
After a friendly
STRG ci got the following result:Usage with verbose mode:
Result:
Endless output.
I think that is not the expected behavior.
The cpulimt version is the actual master branch.
Could that be the solution?