runc/libcontainer/system
Yong Tang a83f5bac28 Fix issue in `GetProcessStartTime`
This fix tries to address the issue raised in docker:
https://github.com/docker/docker/issues/27540

The issue was that `GetProcessStartTime` use space `"  "`
to split the `/proc/[pid]/stat` and take the `22`th value.

However, the `2`th value is inside `(` and `)`, and could
contain space. The following are two examples:
```
ubuntu@ubuntu:~/runc$ cat /proc/90286/stat
90286 (bash) S 90271 90286 90286 34818 90286 4194560 1412 1130576 4 0 2 1 2334 438 20 0 1 0 3093098 20733952 823 18446744073709551615 1 1 0 0 0 0 0 3670020 1266777851 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0
ubuntu@ubuntu:~/runc$ cat /proc/89653/stat
89653 (gunicorn: maste) S 89630 89653 89653 0 -1 4194560 29689 28896 0 3 146 32 76 19 20 0 1 0 2971844 52965376 3920 18446744073709551615 1 1 0 0 0 0 0 16781312 137447943 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0
```

This fix fixes this issue by removing the prefix before `)`,
then finding the `20`th value (instead of `22`th value).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-20 11:34:21 -07:00
..
linux.go Fix trivial style errors reported by `go vet` and `golint` 2016-04-12 08:13:16 +00:00
proc.go Fix issue in `GetProcessStartTime` 2016-10-20 11:34:21 -07:00
proc_test.go Fix issue in `GetProcessStartTime` 2016-10-20 11:34:21 -07:00
setns_linux.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
syscall_linux_64.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
syscall_linux_386.go Support 32 bit UID on i386 2016-08-16 22:47:38 +02:00
syscall_linux_arm.go Fix build tags 2015-07-01 13:22:09 -07:00
sysconfig.go Cleanup GetLongBit 2016-08-02 09:04:30 +08:00
sysconfig_notcgo.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
unsupported.go Stub RunningInUserNS for non-Linux 2016-03-03 16:33:43 -05:00
xattrs_linux.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00