jcnelson / vdev

A device-file manager for *nix
GNU General Public License v3.0
101 stars 13 forks source link

Chromium and libudev-compat #58

Open fbt opened 9 years ago

fbt commented 9 years ago

Chromium doesn't work with vdev's libudev. Here's a strace.

Not sure if it's chromium or libudev-compat being silly, but as it works with eudev, I've decided to poke you first.

onimatrix81 commented 9 years ago

Yeah, google-chrome-44.0.2403.155_p1 dies for me too. [13504:13504:0830/175408:ERROR:sandbox_linux.cc(345)] InitializeSandbox() called with multiple threads in process gpu-process

jcnelson commented 9 years ago

Thanks for the strace! The lines at the very end look interesting:

11004: [    libudev-fs.c:0416] udev_monitor_fs_setup: mkdir('/dev/metadata/udev/events/libudev-11004/') rc = -13
11004: [    libudev-fs.c:0570] udev_monitor_fs_destroy: open('/dev/metadata/udev/events/libudev-11004/') rc = -2
11004: [libudev-monitor.c:0130] udev_monitor_new_from_filesystem: udev_monitor_fs_setup() rc = -13

A bit of background: libudev-compat works by creating a PID-specific directory in /dev/metadata/udev/events/ and watching it for new files to be created. Each file will contain a uevent-like packet of KEY=VALUE pairs that can be parsed into a struct udev_device. The udev-compat.sh helper in vdev is responsible for querying vdev's /dev/metadata database and and generating these files.

It looks like what's happening here is that /dev/metadata/udev/events is not writeable to Chromium. Can you verify whether or not this is the case? dev-setup.sh is responsible for making this directory, and it looks like it's not creating it world-writeable (or writeable to a hypothetical group of hotplug-subscribers).

onimatrix81 commented 9 years ago

chmod -r 777 /dev/metadata/udev/events removed the problem for me.

onimatrix81 commented 9 years ago

Oh and yeah, there permissions were as this before the chmod: drwxr-xr-x 6 root root 120 30. 8. 18:50 . drwxr-xr-x 6 root root 140 30. 8. 07:52 .. drwxr-xr-x 2 root root 40 30. 8. 20:15 global drwx------ 2 root virgini 2.0K 30. 8. 20:15 libudev-7400 drwx------ 2 root virgini 2.0K 30. 8. 20:15 libudev-7401 drwx------ 2 root root 40 30. 8. 20:15 libudev-7629

fbt commented 9 years ago

Yep. I feel stupid for not checking now. /dev/metadata/udev/events is being crated with root:root 755.

jcnelson commented 9 years ago

I feel stupid for not explicitly chmod-ing the directories. This has been fixed as of 9aed0db64133d0d82b0bbe355b07d270123fbf4e.

fbt commented 9 years ago

It works with 777, but as with any tmp-like dir, it's better to make it 1777, so that other users can't remove your stuff.

jcnelson commented 9 years ago

@fbt Good catch; just pushed a fix.