-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pg_top inside a LXC container (unprivileged on ProxMox) #10
Comments
Looks like |
Commit f6232a9 shows that sprintf(buffer, "%d/io", proc->pid);
fd = open(buffer, O_RDONLY);
if (fd == -1)
{
/*
* CONFIG_TASK_IO_ACCOUNTING is not enabled in the Linux kernel or
* this version of Linux may not support collecting i/o statistics per
* pid. Report 0's.
*/
proc->rchar = 0;
proc->wchar = 0;
proc->syscr = 0;
proc->syscw = 0;
proc->read_bytes = 0;
proc->write_bytes = 0;
proc->cancelled_write_bytes = 0;
return;
}
len = read(fd, buffer, sizeof(buffer) - 1);
close(fd); I can't reproduce the segfaulting running lxc/lxd on Gentoo when I run pg_top as a user that does not have read access to |
I'm seeing this when running
I'm obviously doing something wrong ... can this even compile as-is for debian, or does it need a patch? Is there a chance 4.0 alpha can hit next debian release? |
Yes, pg_top should be able to compile as-in on debian.
I'm not directly involved in any distro packaging. I'm afraid I'm not sure when packaging will be updated... |
The error is a segmentation fault, looking at strace and ltrace we see the permission and array check error:
strace:
open("5401/io", O_RDONLY) = 4
read(4, 0x7ffd4c67c360, 4095) = -1 EACCES (Permission denied)
close(4) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x2} ---
+++ killed by SIGSEGV +++
Segmentation fault
ltrace:
[pid 25433] open("5401/io", 0, 07332762347) = 4
[pid 25433] read(4 <no return ...>
error: maximum array length seems negative
, "5401/io", 4095) = -1
[pid 25433] close(4) = 0
[pid 25433] strchr("5401/io", ':') = nil
[pid 25433] strchr("\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"..., '\n' <no return ...>
[pid 25433] --- SIGSEGV (Segmentation fault) ---
[pid 25433] +++ killed by SIGSEGV +++
The text was updated successfully, but these errors were encountered: