When changing my MACHINE from atom-pc to beagleboard, trying to build a recipe results in the following. It isn't clear to me from this why it's doing any kind of a qemu check as the machine isn't a qemu machine. It also isn't clear why this change should be necessary in the first place as qemu works on my system without that change. Similar thoughts on the OE wiki: http://wiki.openembedded.net/index.php/Category_talk:FAQ#9._sanity_checker_complains_.22.2Fproc.2Fsys.2Fvm.2Fmmap_min_addr_is_not_0.22_on_Ubuntu $ bitbake perl FATAL: Poky's config sanity checker detected a potential misconfiguration. Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). Following is the list of potential problems / advisories: /proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root). To fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.
*** Bug 662 has been marked as a duplicate of this bug. ***
Edwin, Please confirm that the mmap_min_addr patch is no longer needed with the latest qemu and if so, then remove this sanity check.
(In reply to comment #2) > Edwin, Please confirm that the mmap_min_addr patch is no longer needed with the > latest qemu and if so, then remove this sanity check. Saul, I'm not in the mmap_min_addr context, but I assume if I can build qemuarm minimal image, and run without these checks, then it's okay. Right?
So, when I brought this up to Richard before, his answer was (to paraphrase) that he had a recollection of someone saying there were still corner cases and that it wasn't 100% fixed upstream (despite upstream saying it was fixed).
(In reply to comment #4) > So, when I brought this up to Richard before, his answer was (to paraphrase) > that he had a recollection of someone saying there were still corner cases and > that it wasn't 100% fixed upstream (despite upstream saying it was fixed). The corner cases are when user account running bitbake (and then qemu) is not allowed to read /proc/sys/vm/mmap_min_addr and adjust mmap_min_addr in qemu accordingly. That's why OE still has http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=93a439a42b538be1f96c9250122504bfbdbd8d7b And that's why this check will fail to read /proc/sys/vm/mmap_min_addr on some kernels and report "maybe false positive", see: http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg02340.html And here is response on qemu-devel: http://www.mail-archive.com/qemu-devel@nongnu.org/msg31804.html but c581deda322080e8beb88b2e468d4af54454e4b3 afaik didn't solve it completely
(In reply to comment #5) > (In reply to comment #4) > > So, when I brought this up to Richard before, his answer was (to paraphrase) > > that he had a recollection of someone saying there were still corner cases and > > that it wasn't 100% fixed upstream (despite upstream saying it was fixed). > > The corner cases are when user account running bitbake (and then qemu) is not > allowed to read /proc/sys/vm/mmap_min_addr and adjust mmap_min_addr in qemu > accordingly. > > That's why OE still has > http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=93a439a42b538be1f96c9250122504bfbdbd8d7b > > And that's why this check will fail to read /proc/sys/vm/mmap_min_addr on some > kernels and report "maybe false positive", see: > http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg02340.html > > And here is response on qemu-devel: > http://www.mail-archive.com/qemu-devel@nongnu.org/msg31804.html > but c581deda322080e8beb88b2e468d4af54454e4b3 afaik didn't solve it completely Martin, Thanks for your reply. It's more clear now. There is in fact 2 issues: 1. qemu linux-user doesn't reload it well, so we need set the mmap_min_addr to 0. And qemu c581deda322080e8beb88b2e468d4af54454e4b3 fix it (already in 0.13.0). 2. Another issue is user on some distribution can't access the mmap_min_addr, so your patch assume 65536(from most of popular distribution) in such case. Is it right? I think issue 1 depends on 2, but not sure if these 2 fixes conflict?
So proper solution is adding Martin's patch in case that end user has no access of the /proc/..../mmap_min_addr and removed our checks. If so I'll have a test to see if qemuarm can be built and run well with this solution. Another question is: does our check in sanity.bbclass have such access issue?
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > So, when I brought this up to Richard before, his answer was (to paraphrase) > > > that he had a recollection of someone saying there were still corner cases and > > > that it wasn't 100% fixed upstream (despite upstream saying it was fixed). > > > > The corner cases are when user account running bitbake (and then qemu) is not > > allowed to read /proc/sys/vm/mmap_min_addr and adjust mmap_min_addr in qemu > > accordingly. > > > > That's why OE still has > > http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=93a439a42b538be1f96c9250122504bfbdbd8d7b > > > > And that's why this check will fail to read /proc/sys/vm/mmap_min_addr on some > > kernels and report "maybe false positive", see: > > http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg02340.html > > > > And here is response on qemu-devel: > > http://www.mail-archive.com/qemu-devel@nongnu.org/msg31804.html > > but c581deda322080e8beb88b2e468d4af54454e4b3 afaik didn't solve it completely > Martin, > Thanks for your reply. It's more clear now. There is in fact 2 issues: > 1. qemu linux-user doesn't reload it well, so we need set the mmap_min_addr to > 0. And qemu c581deda322080e8beb88b2e468d4af54454e4b3 fix it (already in > 0.13.0). > 2. Another issue is user on some distribution can't access the mmap_min_addr, > so your patch assume 65536(from most of popular distribution) in such case. > Is it right? > I think issue 1 depends on 2, but not sure if these 2 fixes conflict? Now in poky we have qemu 0.13.0, and we also have the patch: http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=ea63409781dc9a5de2d852ec044e55dc82e31a96 "qemu-0.13.0: Add patch to avoid mmap_min_addr * This patch is taken from OE commit 40e293342ca76921904a43b03b635d9219432edf (From OE-Core rev: 11d76595e036f46906859b59dc06094b2e979771) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>" So I think the bug was actually fixed? (In reply to comment #7) > So proper solution is adding Martin's patch in case that end user has no access > of the /proc/..../mmap_min_addr and removed our checks. > If so I'll have a test to see if qemuarm can be built and run well with this > solution. > Another question is: does our check in sanity.bbclass have such access issue? The code in sanity.bbclass is: if data.getVar('TARGET_ARCH', e.data, True) == "arm": # This path is no longer user-readable in modern (very recent) Linux try: if os.path.exists("/proc/sys/vm/mmap_min_addr"): f = file("/proc/sys/vm/mmap_min_addr", "r") if (f.read().strip() != "0"): messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n" f.close() except: pass So I think bitbake can ignore the exception safely.
I have tested arm build without Raj's patch, and everything works well. In theory, Raj's patch should not cause any regression. I'll make a new test with Raj's patch, then send pull request if no regression.
Fixed in poky master @ 0bc244181fce67725ddd0981481e5611b700cf51