Tag Archives: hack

“Broken sem_open function (bug 496328)” error when compiling python_2.7:

I have installed Gentoo on a Thinkpad T42 laptop. I have problem setting up wireless network but that is for another day. This blog is related to problem I faced during my system upgrade.

When I tried to do system upgrade, python emerge failed with following error message: ‘”Broken sem_open function (bug 496328)” error when compiling python_2.7:’. There were instructions to –rbind /dev from live media. But I had done it. There were instructions to remount /dev/shm on tmpfs and with mode=1777 permission. But trying to mount failed with no such file/directory error. Then I noticed something.

Since, network is not working (currently) on my Gentoo installation, I chroot from linuxmint on this office laptop and do all installtion/upgradation. Mint has /dev/shm pointing to /run/shm which was empty i.e., there is nothing under /run.

I removed /dev/shm link, created a directory /dev/shm and mounted as tmpfs with 777 permission. After this, python emerge went smoothly.

(chroot) mint-t42 / # rm /dev/shm
(chroot) mint-t42 / # mkdir /dev/shm
(chroot) mint-t42 / # mount -t tmpfs -o rw,mode=1777 shm /dev/shm
(chroot) mint-t42 / # ls -l /dev/ | grep -i shm
drwxrwxrwt 2 root root 40 May 25 11:26 shm
(chroot) mint-t42 / # df -h
df: '/sys/fs/cgroup/openrc': No such file or directory
df: '/sys/fs/cgroup/cpuset': No such file or directory
df: '/sys/fs/cgroup/cpu': No such file or directory
df: '/sys/fs/cgroup/cpuacct': No such file or directory
df: '/sys/fs/cgroup/freezer': No such file or directory
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 21G 4.8G 15G 25% /
tmpfs 21G 4.8G 15G 25% /run
udev 10M 0 10M 0% /dev
cgroup_root 4.0K 0 4.0K 0% /sys/fs/cgroup
shm 759M 0 759M 0% /dev/shm
(chroot) mint-t42 / # mount | grep -i shm
shm on /dev/shm type tmpfs (rw,mode=1777)
(chroot) mint-t42 / #

I don’t know how clean the method is but what I tried worked for me. Once I get network working in Gentoo, I don’t have to chroot anyway.