New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 918499 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

security.SELinuxProcesses fails flakily with "no such process"

Project Member Reported by derat@chromium.org, Jan 2

Issue description

In https://ci.chromium.org/p/chromeos/builders/luci.chromeos.general/CQ/b8925459339075851920, security.SELinuxProcesses failed due to a process not being found:

2019/01/02 01:04:35 Started test security.SELinuxProcesses
2019/01/02 01:04:35 [01:04:35.319] Error at selinux_processes.go:35: Failed to get processes: read /proc/4936/cmdline: no such process
2019/01/02 01:04:35 [01:04:35.319] Stack trace:
Failed to get processes
	at chromiumos/tast/local/bundles/cros/security.SELinuxProcesses (selinux_processes.go:35)
	at chromiumos/tast/testing.(*Test).Run.func4 (test.go:228)
	at chromiumos/tast/testing.runStages.func1.1 (stage.go:39)
	at chromiumos/tast/testing.runAndRecover.func1 (stage.go:69)
	at runtime.goexit (asm_arm.s:1015)
read /proc/4936/cmdline: no such process
2019/01/02 01:04:35 Completed test security.SELinuxProcesses in 396ms with 1 error(s)

selinux.GetProcesses currently calls os.IsNotExist on errors that gopsutil returns while reading data from /proc and skips only os.ErrNotExist. It looks from the above message like gopsutil can also return "no such process" errors (I think that this is ESRCH).

This code should probably skip all errors instead. I don't see any promises from gopsutil about what errors it will return, so it's unsafe to depend on specific behavior.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/2ac19e0aaaa272422f9f73d1ff5e07aacb390cbc

commit 2ac19e0aaaa272422f9f73d1ff5e07aacb390cbc
Author: Daniel Erat <derat@chromium.org>
Date: Thu Jan 03 02:14:04 2019

tast-tests: Fix proc flakiness in security.SELinuxProcesses.

Make the security.SELinuxProcesses test ignore all errors
returned by gopsutil when trying to read process data. The
test previously assumed that os.ErrNotExist would be always
be returned if a process went away mid-test, but this
appears to not be the case.

Also reformat some related error-handling code.

BUG= chromium:918499 
TEST=ran test successfuly on a caroline device

Change-Id: Ic8d90aa83f4f2d43dd20b6ee065420e2fc031570
Reviewed-on: https://chromium-review.googlesource.com/1392530
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[modify] https://crrev.com/2ac19e0aaaa272422f9f73d1ff5e07aacb390cbc/src/chromiumos/tast/local/bundles/cros/security/selinux/processes_helper.go

Status: Fixed (was: Started)

Sign in to add a comment