WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Problem with tmpfs, /dev/shm does not exist or is not writable, there is no support for shared memory

Open patryk9200 opened this issue 10 years ago • 11 comments

Hi! It's look like there is no proper support for shared memory. I'm trying to compile linux Yocto image for Embedded ARM freescale i.mx6 UL based SOM. When I trying to build image using bitbake it always returns: /dev/shm does not exist or is not writable

There ins no difference if I run bitbake as root or as sudo user.

Is there in Linux Subsystem for Windows properly implemented tmpfs? There is no info about tmpfs in fstab.

stat /dev/shm on WLS returns:

stat /dev/shm File: ‘/dev/shm’ -> ‘/run/shm’ Size: 0 Blocks: 1 IO Block: 512 symbolic link Device: 0h/0d Inode: 0 Links: 2 Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2016-04-07 11:36:10.539632000 +0000 Modify: 2016-04-07 11:36:10.000000000 +0000 Change: 2016-04-07 11:36:10.000000000 +0000 Birth: -

File: ‘/run/shm’ Size: 0 Blocks: 0 IO Block: 512 regular empty file Device: 0h/0d Inode: 13510798882223683 Links: 1 Access: (0666/-rw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2016-04-07 11:40:06.680796000 +0000 Modify: 2016-04-07 11:40:06.680796000 +0000 Change: 2016-04-07 11:40:06.680796000 +0000 Birth: -

On linux machine returns: File: '/dev/shm' Size: 40 Blocks: 0 IO Block: 4096 directory Device: 12h/18d Inode: 11798 Links: 2 Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2016-02-22 14:40:14.096000000 +0000 Modify: 2016-02-22 14:40:14.096000000 +0000 Change: 2016-02-22 14:40:14.096000000 +0000 Birth: -

On linux it is directory with access 17777 but on WLS it is file with access 0666.

System: Windows Insider Preview build 14316.rs1_release

patryk9200 avatar Apr 07 '16 08:04 patryk9200

Thanks for reporting the issue. We recently added tmpfs mounts for run (e.g. /run, /run/lock, /run/user, and /run/shm) with permissions that match native Ubuntu. This change should be out for insiders soon.

Can you please share out a simplified repro for bitbake so we can check if it is resolved? We can also try out the scenarios in the referenced issues to make sure they are resolved.

stehufntdev avatar Apr 14 '16 18:04 stehufntdev

@stehufntdev for an easy test of /dev/shm see #135

trondhindenes avatar Apr 14 '16 20:04 trondhindenes

Thanks @trondhindenes I saw that one as well, and will reply off it shortly. Since /dev/shm is just a tmpfs mount I wanted to see if bitbake had different dependencies from python.

stehufntdev avatar Apr 14 '16 20:04 stehufntdev

@stehufntdev

Thank You for looking into this problem. Sorry I was unable to replay earlier.

I made a little simplified repro for that issue.

First You need to add not root linux user.

Then You need to install packages:

apt install wget git gcc unzip build-essential intltool gawk git-core diffstat unzip texinfo chrpath libsdl1.2-dev xterm curl qemu git-core gcc-multilib socat autoconf automake libtool libglib2.0-dev libarchive-dev

If all packages are installed execute:

su YOUR_NOT_ROOT_USER mkdir ~/bin curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo PATH=$PATH:~/bin chmod a+x ~/bin/repo mkdir fsl-community-bsp git config --global user.email "YOUR_EMAIL_ADDRESS" git config --global user.name "YOUR_USER_NAME" repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b jethro repo sync repo start zamel-imx6UL-dev zamel-imx6UL --all source setup-environment build

Then (failing bitbake):

bitbake -c menuconfig core-image-minimal

That's all.

I allways get:

FATAL: /dev/shm does not exist or is not writable

patryk9200 avatar Apr 18 '16 06:04 patryk9200

Thanks for providing the repro. Just tried this locally and it seems to make it a bit further but reports a failure missing support in inotify:

_test@TEST-6:~/build$ bitbake -c menuconfig core-image-minimal Traceback (most recent call last): File "/home/test/sources/poky/bitbake/bin/bitbake", line 45, in cookerdata.CookerConfiguration())) File "/home/test/sources/poky/bitbake/lib/bb/main.py", line 395, in bitbake_main server = start_server(servermodule, configParams, configuration, featureset) File "/home/test/sources/poky/bitbake/lib/bb/main.py", line 293, in start_server cooker = bb.cooker.BBCooker(configuration, features) File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 140, in init self.initConfigurationData() File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 372, in initConfigurationData self.add_filewatch(self.data.getVar("_base_depends", False), self.configwatcher) File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 216, in add_filewatch watcher.add_watch(f, self.watchmask, quiet=False) File "/home/test/sources/poky/bitbake/lib/pyinotify.py", line 1977, in add_watch raise WatchManagerError(err, ret) WatchManagerError: add_watch: cannot watch /home/test/build/conf WD=-1, Errno=Invalid argument (EINVAL) DEBUG: Removed the following variables from the environment: LANG, LESSCLOSE, NAME, SHLVL, OLDPWD, HOSTTYPE, LESSOPEN, MAIL, LS_COLORS, , BUILDDIR DEBUG: Found bblayers.conf (/home/test/build/conf/bblayers.conf) DEBUG: Adding layer /home/test/sources/poky/meta DEBUG: Adding layer /home/test/sources/poky/meta-yocto DEBUG: Adding layer /home/test/sources/meta-openembedded/meta-oe DEBUG: CONF /home/test/sources/meta-openembedded/meta-oe/conf/layer.conf:67: including conf/distro/include/meta_oe_security_flags.inc DEBUG: Adding layer /home/test/sources/meta-openembedded/meta-multimedia DEBUG: Adding layer /home/test/sources/meta-fsl-arm DEBUG: Adding layer /home/test/sources/meta-fsl-arm-extra DEBUG: Adding layer /home/test/sources/meta-fsl-demos DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:697: including conf/abi_version.conf DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:698: including conf/site.conf DEBUG: CONF file 'conf/site.conf' not found DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:699: including conf/auto.conf DEBUG: CONF file 'conf/auto.conf' not found DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:700: including conf/local.conf DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:701: including conf/build/x86_64-linux.conf DEBUG: CONF file 'conf/build/x86_64-linux.conf' not found DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:702: including conf/target/INVALID-oe-linux.conf DEBUG: CONF file 'conf/target/INVALID-oe-linux.conf' not found DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:703: including conf/machine/imx6qsabresd.conf DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/imx6qsabresd.conf:7: including conf/machine/include/imx6sabresd-common.inc DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx6sabresd-common.inc:3: including conf/machine/include/imx-base.inc DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:3: including conf/machine/include/fsl-default-settings.inc DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:4: including conf/machine/include/fsl-default-versions.inc DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:6: including conf/machine/include/soc-family.inc DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx6sabresd-common.inc:4: including conf/machine/include/tune-cortexa9.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/tune-cortexa9.inc:3: including conf/machine/include/arm/arch-armv7a.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv7a.inc:8: including conf/machine/include/arm/arch-armv6.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv6.inc:8: including conf/machine/include/arm/arch-armv5-dsp.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc:4: including conf/machine/include/arm/arch-armv5.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5.inc:10: including conf/machine/include/arm/arch-armv4.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv4.inc:15: including conf/machine/include/arm/arch-arm.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv4.inc:16: including conf/machine/include/arm/feature-arm-thumb.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5.inc:11: including conf/machine/include/arm/feature-arm-vfp.inc DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv7a.inc:9: including conf/machine/include/arm/feature-arm-neon.inc DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:704: including conf/machine-sdk/${SDKMACHINE}.conf DEBUG: CONF file 'conf/machine-sdk/${SDKMACHINE}.conf' not found DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:705: including conf/distro/poky.conf DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:706: including conf/distro/defaultsetup.conf DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:1: including conf/distro/include/default-providers.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:2: including conf/distro/include/default-versions.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:3: including conf/distro/include/default-distrovars.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:4: including conf/distro/include/world-broken.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:7: including conf/distro/include/tcmode-default.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/include/tcmode-default.inc:74: including conf/distro/include/as-needed.inc DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:10: including conf/distro/include/tclibc-glibc.inc DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:707: including conf/documentation.conf DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:708: including conf/licenses.conf DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:709: including conf/sanity.conf DEBUG: Inheriting /home/test/sources/poky/meta/classes/base.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/patch.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:4) DEBUG: Inheriting /home/test/sources/poky/meta/classes/terminal.bbclass (from /home/test/sources/poky/meta/classes/patch.bbclass:8) DEBUG: Inheriting /home/test/sources/poky/meta/classes/staging.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:5) DEBUG: Inheriting /home/test/sources/poky/meta/classes/mirrors.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:7) DEBUG: Inheriting /home/test/sources/poky/meta/classes/utils.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:8) DEBUG: Inheriting /home/test/sources/poky/meta/classes/utility-tasks.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:9) DEBUG: Inheriting /home/test/sources/poky/meta/classes/metadata_scm.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:10) DEBUG: Inheriting /home/test/sources/poky/meta/classes/logging.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:11) DEBUG: Inheriting /home/test/sources/meta-fsl-arm/classes/fsl-dynamic-packagearch.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta-yocto/classes/poky-sanity.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/package_rpm.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/package.bbclass (from /home/test/sources/poky/meta/classes/package_rpm.bbclass:1) DEBUG: Inheriting /home/test/sources/poky/meta/classes/packagedata.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:41) DEBUG: Inheriting /home/test/sources/poky/meta/classes/chrpath.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:42) DEBUG: Inheriting /home/test/sources/poky/meta/classes/insane.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:45) DEBUG: Inheriting /home/test/sources/poky/meta/classes/buildstats.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/image-mklibs.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/debian.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/devshell.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/sstate.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/license.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/blacklist.bbclass (from configuration INHERITs:0) DEBUG: Inheriting /home/test/sources/poky/meta/classes/sanity.bbclass (from configuration INHERITs:0) DEBUG: Clearing SRCREV cache due to cache policy of: clear DEBUG: Using cache in '/home/test/build/cache/local_file_checksum_cache.dat' DEBUG: Using cache in '/home/test/build/cache/bb_codeparser.dat'

From the strace:

12183 inotify_add_watch(7, "/home/test/build/conf", IN_MODIFY|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF) = -1 EINVAL (Invalid argument)

If it looks like this is still broken, can you please add it to our [UserVoice](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash page) page so we can prioritize? Thanks again for trying out WSL!

stehufntdev avatar Apr 18 '16 16:04 stehufntdev

@stehufntdev Thank You for checking this issue. I think that someone else reported here that inotify is not implemented. I will definietly add it to UserVoice. Thanks.

Edit: found it: #216

patryk9200 avatar Apr 18 '16 16:04 patryk9200

I just added at UserVoice request for filesystem watchers & inotify. https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13469097-support-for-filesystem-watchers-like-inotify

patryk9200 avatar Apr 18 '16 16:04 patryk9200

Closing since this is fixed.

benhillis avatar May 28 '16 17:05 benhillis

Are we certain this has been addressed?

I've tried Yocto (bitbake) on computers running both Insider Fast and Anniversary Update, and in both cases, it fails with WatchManagerError: add_watch: cannot watch /home/jay/yocto/build/conf WD=-1, Errno=Invalid argument (EINVAL)

Getting Yocto to work on Services for Linux would be huge -- I'm sure there are a ton of embedded programmers like me who keep a Linux VM around for the sole purpose of building embedded Linux images...

jaydcarlson avatar Aug 03 '16 07:08 jaydcarlson

You are seeing #216. Also, some even have a dedicated machine just for Yocto...

Tragetaschen avatar Aug 03 '16 08:08 Tragetaschen

@jaydcarlson -- the way the folks at Microsoft are judging how huge a thing is, is (in part) by how many people have indicated that it's important to them. The way they've asked people to do that is through the UserVoice page. So if there's a community out there that this matters a lot to, y'all should go make some noise over there.

aseering avatar Aug 03 '16 13:08 aseering