Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7019808

build fails on Fedora 14: SELinux run-time check: execution of stack in libjvm.so

XMLWordPrintable

    • b12
    • x86
    • linux
    • Not verified

        Build of JDK7 trunk fails on Fedora 14 due to SELinux check:
        libjvm.so is marked as trying to execute its stack, so in order for build to proceed one has to disable this check, either by turning off the SELinux functionality or by disabling just that stack execution check thus:

          sudo setsebool allow_execstack=on

        This is the error I saw in the build:

        cd linux_amd64_compiler2/fastdebug && ./test_gamma
        java full version "1.6.0_23-b05"
        ./gamma: error while loading shared libraries: libjvm.so: cannot enable executable stack as shared object requires: Permission denied

        With strace we see what's happening:

        [pid 2700] execve("./gamma", ["./gamma", "-Xbatch", "-showversion", "Queens"], [/* 36 vars */]) = 0
        [pid 2700] brk(0) = 0x9e7000
        [pid 2700] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f789c39a000
        [pid 2700] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
        [pid 2700] open("./tls/x86_64/libjvm.so", O_RDONLY) = -1 ENOENT (No such file or directory)
        [pid 2700] open("./tls/libjvm.so", O_RDONLY) = -1 ENOENT (No such file or directory)
        [pid 2700] open("./x86_64/libjvm.so", O_RDONLY) = -1 ENOENT (No such file or directory)
        [pid 2700] open("./libjvm.so", O_RDONLY) = 4
        [pid 2700] read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\215 \0\0\0\0\0"..., 832) = 832
        [pid 2700] fstat(4, {st_mode=S_IFREG|0775, st_size=19803690, ...}) = 0
        [pid 2700] getcwd("/home/dw136774/jdk7-sandbox2/tl/build/linux-amd64-fastdebug/hotspot/outputdir/linux_amd64_compiler2/fastdebug", 128) = 110
        [pid 2700] mmap(NULL, 20004456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7f789b086000
        [pid 2700] mprotect(0x7f789c049000, 2097152, PROT_NONE) = 0
        [pid 2700] mmap(0x7f789c249000, 765952, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xfc3000) = 0x7f789c249000
        [pid 2700] mmap(0x7f789c304000, 613992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f789c304000
        [pid 2700] mprotect(0x7fff32fa8000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = -1 EACCES (Permission denied)
        [pid 2700] close(4) = 0
        [pid 2700] writev(2, [{"./gamma", 7}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libjvm.so", 9}, {": ", 2}, {"cannot en\
        able executable stack a"..., 56}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}], 10./gamma: error while loading shared libraries: libjvm.so: ca\
        nnot enable executable stack as shared object requires: Permission denied

              dsamersoff Dmitriy Samersoff
              dwanvik Dag Wanvik
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: