1 Reply Latest reply on Apr 24, 2012 5:07 PM by 931947

    libdb-5.2.36 not honoring DB_NOMMAP open flag


      Testing with libdb-5.2.36 on Fedora 17, I'm finding that the DB_NOMMAP flag passed to db_env->open() is not being honored.

      Here is the call trace that shows how we reach __os_map() from a simple open call including the 0x8 DB_NOMMAP flag:

      #0 __os_map (env=env@entry=0x8076c10, path=0x8076688 "/var/lib/rpm/__db.001",
      len=0, is_rdonly=is_rdonly@entry=0, addrp=addrp@entry=0x8076f00,
      is_region=<error reading variable: Unhandled dwarf expression opcode 0xfa>, fhp=<error reading variable: Unhandled dwarf expression opcode 0xfa>)
      at ../../src/os/os_map.c:432
      #1 0xb7eba3ab in __os_attach (env=env@entry=0x8076c10,
      infop=infop@entry=0x8076ee8, rp=rp@entry=0xbfffe08c)
      at ../../src/os/os_map.c:225
      #2 0xb7e8aa38 in __env_sys_attach (env=env@entry=0x8076c10, infop=0x8076ee8,
      rp=rp@entry=0xbfffe08c) at ../../src/env/env_region.c:1265
      #3 0xb7e8b611 in __env_attach (env=env@entry=0x8076c10,
      init_flagsp=init_flagsp@entry=0xbfffe18c, create_ok=create_ok@entry=1,
      retry_ok=retry_ok@entry=1) at ../../src/env/env_region.c:235
      #4 0xb7e84c1c in __env_attach_regions (dbenv=dbenv@entry=0x80767c8,
      flags=1161, orig_flags=orig_flags@entry=0, retry_ok=retry_ok@entry=1)
      at ../../src/env/env_open.c:1002
      #5 0xb7e8543c in __env_open (dbenv=dbenv@entry=0x80767c8,
      db_home=db_home@entry=0x80762c0 "/var/lib/rpm", flags=flags@entry=1161,
      mode=mode@entry=420) at ../../src/env/env_open.c:209
      #6 0xb7e857c8 in __env_open_pp (dbenv=0x80767c8,
      db_home=0x80762c0 "/var/lib/rpm", flags=1161, mode=420)
      at ../../src/env/env_open.c:114

      This is causing all apps that use berkdb to fail to work on JFFS2, which is an embedded filesystem that doesn't support writable mmap. It worked OK on earlier versions of berkdb such as db4-v4.8.30.

      Is this a known issue? Any solutions available? I'm happy to test patches.


      Edited by: 928944 on 19-abr-2012 15:08