Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12991

Segmentation fault during V8 initialization on grsecurity Linux kernel

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: None
    • None
    • ALL
    • Hide

      1. Use kernel GR patched kernel: http://molly.corsac.net/~corsac/debian/kernel-grsec/packages/wheezy/
      add

      deb http://molly.corsac.net/~corsac/debian/kernel-grsec/packages/ wheezy/
      

      run

      apt-get install linux-image-3.2.45.1-grsec
      

      and reboot

      2. Install mongodb-org from http://downloads-distro.mongodb.org:
      add

      deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen
      

      to apt sources
      and run

      apt-get install mongodb-org
      

      3. run

      mongo
      
      Show
      1. Use kernel GR patched kernel: http://molly.corsac.net/~corsac/debian/kernel-grsec/packages/wheezy/ add deb http://molly.corsac.net/~corsac/debian/kernel-grsec/packages/ wheezy/ run apt-get install linux-image-3.2.45.1-grsec and reboot 2. Install mongodb-org from http://downloads-distro.mongodb.org: add deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen to apt sources and run apt-get install mongodb-org 3. run mongo

      On GRSEC + PAX patched kernel the mongo client crashes (segmentation fault)

      2014-03-03T11:11:46.662+0100 WARNING: Cannot detect if NUMA interleaving is enabled. Failed to probe "/sys/devices/system/node/node1": Permission denied
      MongoDB shell version: 2.6.0-rc0
      mongo got signal 11 (Segmentation fault), stack trace: 
      0x85cd81 0x61a182 0x6e3c65a034f0 0xb3fdb5 0xc0eabf 0xb40dde 0xb40df9 0xbdc82e 0xb217c2 0xbdc960 0x952ad7 0xbe337a 0x7a0175 0x7b2959 0x61d9d9 0x6203a3 0x6e3c659efead 0x618d49 
       mongo(_ZN5mongo15printStackTraceERSo+0x21) [0x85cd81]
       mongo(_Z12quitAbruptlyi+0x3b2) [0x61a182]
       /lib/x86_64-linux-gnu/libc.so.6(+0x324f0) [0x6e3c65a034f0]
       mongo(_ZN2v88internal2OS8AllocateEmPmb+0xe5) [0xb3fdb5]
       mongo(_ZN2v88internal28CreateTranscendentalFunctionENS0_19TranscendentalCache4TypeE+0x3f) [0xc0eabf]
       mongo(_ZN2v88internal22init_fast_sin_functionEv+0xe) [0xb40dde]
       mongo(_ZN2v88internal14POSIXPostSetUpEv+0x9) [0xb40df9]
       mongo(_ZN2v88internal2V828InitializeOncePerProcessImplEv+0x3e) [0xbdc82e]
       mongo(_ZN2v88internal12CallOnceImplEPlPFvPvES2_+0x62) [0xb217c2]
       mongo(_ZN2v88internal2V810InitializeEPNS0_12DeserializerE+0x20) [0xbdc960]
       mongo(_ZN2v82V810InitializeEv+0x47) [0x952ad7]
       mongo(_ZN2v86LockerC1EPNS_7IsolateE+0x9a) [0xbe337a]
       mongo(_ZN5mongo7V8ScopeC1EPNS_14V8ScriptEngineE+0x405) [0x7a0175]
       mongo(_ZN5mongo14V8ScriptEngine11createScopeEv+0x29) [0x7b2959]
       mongo(_Z5_mainiPPcS0_+0x449) [0x61d9d9]
       mongo(main+0x33) [0x6203a3]
       /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x6e3c659efead]
       mongo(__gxx_personality_v0+0x459) [0x618d49]
      

      I've experienced the same error with the 2.5.5 version. I've installed the unstable version because previous versions failed on accessing /sys/devices which is banned by GRSEC patch. Server is now able to start but the client crashes.

      system: Debian wheezy
      kernel: 3.2.45.1-grsec #1 SMP Mon May 27 13:14:33 CEST 2013 x86_64 GNU/Linux
      memory: 1GB
      installed packages:

      ii  mongodb-org                              2.6.0~rc0                     amd64        MongoDB cross-platform document-oriented database system (metapackage)
      ii  mongodb-org-mongos                       2.6.0~rc0                     amd64        MongoDB sharding router
      ii  mongodb-org-server                       2.6.0~rc0                     amd64        MongoDB database server
      ii  mongodb-org-shell                        2.6.0~rc0                     amd64        MongoDB shell client
      ii  mongodb-org-tools                        2.6.0~rc0                     amd64        MongoDB tools
      

      The tail of the strace log around the crash:

      open("/proc/version", O_RDONLY)         = 3
      fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x722a27d62000
      read(3, "Linux version 3.2.45.1-grsec (ro"..., 1024) = 124
      close(3)                                = 0
      munmap(0x722a27d62000, 4096)            = 0
      open("/proc/meminfo", O_RDONLY)         = 3
      fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x722a27d62000
      read(3, "MemTotal:        1020104 kB\nMemF"..., 1024) = 1024
      close(3)                                = 0
      munmap(0x722a27d62000, 4096)            = 0
      getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=4*1024}) = 0
      write(1, "MongoDB shell version: 2.6.0-rc0"..., 33MongoDB shell version: 2.6.0-rc0
      ) = 33
      open("/dev/urandom", O_RDONLY)          = 3
      read(3, "0\265\34\1\310\27\346N\2\352!\251$\246\302\35\252\23\203{\10\375\21\376\201\333o5/\366\264e"..., 8191) = 8191
      close(3)                                = 0
      mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x722a26399000
      mprotect(0x722a26399000, 4096, PROT_NONE) = 0
      clone(child_stack=0x722a26b98fd0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x722a26b999d0, tls=0x722a26b99700, child_tidptr=0x722a26b999d0) = 6208
      getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
      gettimeofday({1393844278, 60308}, NULL) = 0
      mmap(0x238c04db1000, 4096, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x722a26398000
      mmap(0x722a26398000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)
      munmap(0x722a26398000, 4096)            = 0
      mmap(0x32cca9915000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)
      --- SIGSEGV (Segmentation fault) @ 0 (0) ---
      

        1. mongo_crash.tgz
          3 kB
          Miroslav Zacek

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            miroslav.zacek Miroslav Zacek
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: