Scratchbox on hardy

January 17, 2008 on 11:13 am | In maemo | 14 Comments

I've been running hardy (the upcoming ubuntu LTS release) for a while now. After a kernel update, I noticed I couldn't build any packages anymore due to configure failing when checking if built binaries could be run. A bit of log reading, the error seemed to be: "mmap: permission denied", hmm.

The configure test there should be fairly trivial, but just to be sure, I made a little test program and compiled it. The compiler works just fine but the produced binary gave the same mmap-error, so it seemed the arm emulation was broken. After stracing the binary a bit, I saw that it tried to do mmap(..., 4096, ...), which failed.

The error appeared after a kernel upgrade, so I tried to find something related to mmap in /proc, and find did give me /proc/sys/vm/mmap_min_addr, which had 65536 in it. Running sudo sh -c 'echo 4096 > /proc/sys/vm/mmap_min_addr' was my first instinct and it did indeed fix the problem -- any larger value and the problem resurfaced.

So, if you're running ubuntu hardy (or linux 2.6.24(?)), you might hit this problem; and lowering the mmap_min_addr should help.

14 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Hmmm... any quick fixes for the "Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!" problem when starting scratchbox on Hardy?

  2. inz says:

    The "infamous" vdso -thingie. It can be fixed by echoing "0" to /proc/sys/vm/vdso_enabled.

  3. lopz says:

    yep, use simple command

    echo 0 > /proc/sys/vm/vdso_enabled

    and retry /scratchbox/login

    bye!

  4. manitoba says:

    I can login, now, thanks to your tip. however I can't compile anymore...

    dpkg-buildpackage -rfakeroot -b
    returns
    "checking whether the C compiler works... configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'"

    any hints ?

  5. manitoba says:

    solved :

    echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr

    see http://www.ptlug.org/wiki/Howto_Installing_Maemo_SDK_4

  6. inz says:

    This was the issue my blog post was about -- only the comments are about the vdso issue.

  7. Sateesh says:

    The solution proposed above seems to solve the problem partially. But now I get other errors related to gcc compilation

    ------
    :1: sorry, unimplemented: had to relocate PCH
    :1: confused by earlier errors, bailing out
    ------

    Did some googling about this and found http://gcc.gnu.org/ml/gcc-bugs/2004-05/msg00559.html, which basically says that the gcc compiler's PreCompiled Headers optimization fails because of wrong mmap address. Any clues on how to overcome this?

  8. Niranjan says:

    Thanks for blogging. I was about to undo everything before I came across your blog.

  9. jon says:

    thanks! that just solved my problem.

  10. Matej says:

    Thank you for this information. It worked fine for me.

    However, it seems that this solution doesn't work on Linux kernel 2.6.31 (from rc7 on).

  11. Matej says:

    Note: Ubuntu Karmic uses kernel 2.6.31. Setting mmap_min_addr to 4096 doesn't help.

    In fact, it becomes the cause of failure with newer qemu, which internally sets GUEST_BASE based on mmap_min_addr.

    One should not use mmap_min_addr with qemu 0.10.0.

  12. [...] 4096 then apply it in this way: sysctl-p [ edit ] Installing Maemo SDK also can take a look http : / / inz.fi/blog/2008/01/17/scratchbox-on-hardy / and [...]

  13. jpoikela says:

    thanks, this solved the issue in Karmic also, unlike what Matej said..

  14. Pierre says:

    Hello,

    This trick doesn't work anymore for hathor on Linux 2.6.40.6-0 (fedora 15).

    Still mmap: permission denied

    Has somebody resolved this ?

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress.
Entries and comments feeds. Valid XHTML and CSS. ^Top^