0

I am new to linux. I would like to know what are the important information that I need to know when reading /proc/PID/status file?

Name:   python
Umask:  0002
State:  t (tracing stop)
Tgid:   6279
Ngid:   0
Pid:    6279
PPid:   5563
TracerPid:  1297870
Uid:    1000    1000    1000    1000
Gid:    1000    1000    1000    1000
FDSize: 256
Groups: 4 6 7 20 24 25 27 29 44 104 122 123 124 125 126 128 1000 
NStgid: 6279
NSpid:  6279
NSpgid: 6279
NSsid:  5563
VmPeak:  1832348 kB
VmSize:  1574252 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:    597604 kB
VmRSS:    388448 kB
RssAnon:      380804 kB
RssFile:        7644 kB
RssShmem:          0 kB
VmData:   795500 kB
VmStk:       200 kB
VmExe:      3320 kB
VmLib:    650516 kB
VmPTE:      1884 kB
VmPMD:        20 kB
VmSwap:        0 kB
Threads:    3
SigQ:   2/12774
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001000
SigCgt: 0000000180000002
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000003fffffffff
CapAmb: 0000000000000000
Seccomp:    0
Speculation_Store_Bypass:   unknown
Cpus_allowed:   3f
Cpus_allowed_list:  0-5
Mems_allowed:   1
Mems_allowed_list:  0
voluntary_ctxt_switches:    444816986
nonvoluntary_ctxt_switches: 109554

I try to read the file as the python program hang without giving any error. I want to know why the script stop running in linux screen.

When I use strace sudo strace -vf -o capture.log -p 6279, I got 6279 pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=63124447}, NULL <unfinished ...>.

May I know what does 4 NULL refers to and what does tv_sec, tv_nsec mean?

May I know is the program hang due to lack of memory?

Susan
  • 431
  • 1
  • 4
  • 16
  • What does your python program do? Without specifics, it's difficult, though I would hazard a guess it wouldn't be lack of memory. Possibly an infinite loop? – ewokx Feb 20 '23 at 04:07
  • 1
    Info about the [`pselect`](https://www.systutorials.com/docs/linux/man/2-pselect/) syscall arguments. The `tv_*` are part of the timespec arguments, given in seconds and nanoseconds. I don't think `ptrace` is the correct tool, you should use the Python debugger, [example thread](https://stackoverflow.com/questions/25308847/attaching-a-process-with-pdb) – metatoaster Feb 20 '23 at 04:08
  • Hello ewokx, my python program use deep learning model to inference the data. May I know how can I find whether there is an infinite loop in the script as there is no error for the script? – Susan Feb 20 '23 at 04:16

0 Answers0