New issue
Advanced search Search tips

Issue 810901 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Feb 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Possible race condition when mounting a component

Project Member Reported by chirantan@chromium.org, Feb 9 2018

Issue description

There appears to be a race condition somewhere when loading a component for the first time and then recursively bind mounting the /run/imageloader directory.

From a clean boot, perform the following steps:

$ dbus-send --system --dest=org.chromium.ComponentUpdaterService /org/chromium/ComponentUpdaterService org.chromium.ComponentUpdaterService.LoadComponent string:cros-termina && mount --rbind /run/imageloader /mnt/stateful_partition/test


If you then look in /mnt/stateful_partition/test/cros-termina/<some_version>, it will be empty but /run/imageloader/cros-termina/<version>/ will have a lost+found directory as well as vm_kernel and vm_rootfs.img files.

I don't see anything in the imageloader source that looks fishy.  When it gets a dbus command, it sends a request to its child process and waits for the child process to mount the component before returning.  Is the kernel doing the mount asynchronously?

If you unmount /mnt/stateful_partition/test and then remount with 'mount --rbind', the files in the component directory will show up.

If you unload the component and then re-run the command above, the files will not be visible in the bind mounted location.

Any thoughts?
 
Owner: chirantan@chromium.org
Status: WontFix (was: Untriaged)
Nevermind, this is user error.  The race is in dbus-send: if you use dbus-send without the --print-reply flag then it will not actually wait for the service to reply.  After adding in the --print-reply flag, I haven't been able to reproduce the problem.
Good to know. That's not very user friendly semantics from dbus-send but so be it.
to be fair, dbus-send is a fairly low-level tool.  think of it as plumbing, not porcelain.
Thanks for reporting this. The dbus API org.chromium.ComponentUpdaterService.LoadComponent itself is synchronous (it waits for the image to be mounted before return). So it should either succeed and return the mount point or fail permanently and return an error.

Sign in to add a comment