Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error "msync not declared" on ubuntu trusty, when building on virtual box guest->host filesystem #1008

Closed
pwinston opened this issue Jun 8, 2018 · 14 comments

Comments

@pwinston
Copy link

pwinston commented Jun 8, 2018

I'm trying to compile gperftools-2.7 under ubuntu trusty. Under Vagrant on a mac. When I configure gperftools-2.7 it confirms libunwind is installed, which I installed first.

But make in gperftools-2.7 gives these errors:
src/heap-checker.cc: In static member function ‘static void HeapLeakChecker::IgnoreLiveObjectsLocked(const char*, const char*)’: src/heap-checker.cc:1436:52: error: ‘MS_ASYNC’ was not declared in this scope if (msync(const_cast<char*>(object), size, MS_ASYNC) != 0) { ^ src/heap-checker.cc:1436:60: error: ‘msync’ was not declared in this scope if (msync(const_cast<char*>(object), size, MS_ASYNC) != 0) {

Am I missing a pre-requisite here?

@alk
Copy link
Contributor

alk commented Jul 8, 2018

Missing symbols belong to glibc. I am unsure how they might be missing on your machine.

I just tested building gperftools 2.7 in docker image of ubuntu 14.04 and everything works fine.

@PpvAlx
Copy link

PpvAlx commented Nov 29, 2018

I have the same error on Ubuntu 18.04.1 LTS.

@edhemphill
Copy link

@alk - it does not seem to be an issue with glibc. This appears to be a problem with the autotools configure script in gperftools not detecting the presence of the mmap() and related calls in Ubuntu 18.04 LTS. I am not an autotools expert and do not know how to fix this correctly, but a quick and dirty fix is to add:

#define HAVE_MMAP 1

to src/config.h after running configure.sh

The configure script worked fine for me on older Ubuntu with older gperftools.

@alk
Copy link
Contributor

alk commented Dec 23, 2018

Hm, no issues for me under docker.

docker run -i -t ubuntu:trusty
apt-get update
apt-get install build-essential libunwind8-dev wget
wget https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz
tar xaf gperftools-2.7.tar.gz
cd gperftools-2.7
./configure && make -j8 && echo success

@alk
Copy link
Contributor

alk commented Dec 23, 2018

I also tried docker thing for 18.04. I need someone to attach config.log to try to figure out what happened.

@alk
Copy link
Contributor

alk commented Dec 23, 2018

Fresh VM of ubuntu trusty also has no issues building gperftools 2.7. I need more details about your setup.

@edhemphill
Copy link

ok - my tests are on Ubuntu 18.04 LTS Desktop... I'll try to capture a configure.log later this week.

@alk
Copy link
Contributor

alk commented Dec 25, 2018

Also please attach output of dpkg -l in addition to config.log. In case it is some sort of packages combination.

@edhemphill
Copy link

Here is a config.log of the issue. With gperftools 2.7 release.

This was specifically a vanilla install of Ubuntu 18.04.1 LTS 64-bit on VirtualBox. Only build-essential was installed after install.

config.log
dpkg-l.log

@alk
Copy link
Contributor

alk commented Dec 27, 2018

error code 6 is failing of mmap of file that is smaller than mapping length. Can you also give output of /proc/mounts and echo $HOME ? I think we should still get rid of testing mmap, but I would like to understand what is happening here.

@edhemphill
Copy link

edhemphill commented Dec 28, 2018

Sure thing:

ed@ed-virtualbox:~/host-work/gostuff/src/github.com/WigWagCo/maestro$ cat /proc/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=1989332k,nr_inodes=497333,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=403920k,mode=755 0 0
/dev/sda1 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13849 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
/dev/loop0 /snap/gnome-logs/37 squashfs ro,nodev,relatime 0 0
/dev/loop1 /snap/core/4917 squashfs ro,nodev,relatime 0 0
/dev/loop2 /snap/gnome-3-26-1604/70 squashfs ro,nodev,relatime 0 0
/dev/loop3 /snap/gnome-logs/45 squashfs ro,nodev,relatime 0 0
/dev/loop4 /snap/gtk-common-themes/818 squashfs ro,nodev,relatime 0 0
/dev/loop5 /snap/gnome-characters/103 squashfs ro,nodev,relatime 0 0
/dev/loop6 /snap/core/6130 squashfs ro,nodev,relatime 0 0
/dev/loop7 /snap/gnome-characters/139 squashfs ro,nodev,relatime 0 0
/dev/loop8 /snap/gnome-calculator/260 squashfs ro,nodev,relatime 0 0
/dev/loop11 /snap/gnome-system-monitor/57 squashfs ro,nodev,relatime 0 0
/dev/loop10 /snap/gnome-system-monitor/51 squashfs ro,nodev,relatime 0 0
/dev/loop9 /snap/gnome-calculator/180 squashfs ro,nodev,relatime 0 0
/dev/loop12 /snap/gtk-common-themes/319 squashfs ro,nodev,relatime 0 0
work /home/ed/host-work vboxsf rw,nodev,relatime 0 0
/dev/loop13 /snap/gnome-3-26-1604/74 squashfs ro,nodev,relatime 0 0
tmpfs /run/user/121 tmpfs rw,nosuid,nodev,relatime,size=403916k,mode=700,uid=121,gid=125 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=403916k,mode=700,uid=1000,gid=1000 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sr0 /media/ed/VBox_GAs_5.2.22 iso9660 ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400 0 0
ed@ed-virtualbox:~/host-work/gostuff/src/github.com/WigWagCo/maestro$ echo $HOME
/home/ed

I guess it would seem reasonable to assume mmap is always there.

@alk
Copy link
Contributor

alk commented Dec 28, 2018

Great. This explains "breakage". You're building from directory mounted via vboxsf. I guess it is virtual box thingy that propagates host FS to guest. And apparently it does so in broken, or at least unexpected way.

I am not 100% sure about broken. autoconf code that checks for working mmap is arguably doing it wrong too. It creates files smaller than page size and tries to mmap entire first page. Apparently vboxfs doesn't like it. And I am not sure if it is correctly not liking it.

Anyways, I'll get rid of mmap testing

@alk alk changed the title Build error "msync not declared" on ubuntu trusty Build error "msync not declared" on ubuntu trusty, when building on virtual box guest->host filesystem Dec 28, 2018
@edhemphill
Copy link

OK - totally get that @alk . vboxsf just has too many issue. Just as you wrote this I switched this box to using a NFS share from the guest. Thanks for following up. Hopefully this helps others.

alk added a commit that referenced this issue Apr 8, 2019
This should alleviate vboxfs problems from issue #1008.
@alk
Copy link
Contributor

alk commented Apr 8, 2019

Merged a fix.

@alk alk closed this as completed Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants