This forum has been archived. Please start a new discussion on GitHub.

inheritence test hangs

Hi all,

As a (perhaps-soon-to-be-ex) CORBA/C++ guy, I've been interested in trying out ICE, and it looks pretty cool from the docs. I'm trying to get 1.0.1 running on a RedHat 9 box. I got past the compile errors thanks to some posts in this forum. Running the tests, I get to:

*** running tests in ./test/Ice/inheritance:

starting server... ok
starting client... ok

Wherupon it just hangs forever. Well, OK, not forever, but for longer than I want to wait around for a test to complete. ;-)

Any ideas?



  • mes
    mes California

    RH9 uses a new threading model by default which causes this hang. Until this issue is resolved, the solution is to set the following environment variable:

    export LD_ASSUME_KERNEL=2.4.1

    Take care,
    - Mark
  • that's the ticket -- new problem: DB_ENV->open: Function not implemented

    Thanks, that seems to do the trick.

    I noticed that 1.1.0 was available, so I dowloaded it and tried it. (Used the same LD_ASSUME_KERNEL=2.4.1). Now I get the following:

    *** running tests in ./test/Freeze/cursor:

    starting client... ok
    DBI.cpp:141: Freeze::DBException:
    Freeze::DBEnvironment("./test/Freeze/cursor/db"): DB_ENV->open: Function not implemented
    test failed with exit status 1

    This seems like a Berkeley DB error. I have version 4.1.1. Any ideas on this one?


  • mes
    mes California
    Yes, I've seen that error as well when I tried building Ice against the native BerkeleyDB installed by default on RH9. I'm assuming that RedHat is installing a minimal version of BerkeleyDB, so I'm afraid you'll need to build it yourself.

    If you're planning to use Ice for Java, don't forget to use the --enable-java option when configuring BerkeleyDB.

    - Mark
  • Hmm, I did build Berkeley DB on this box for another project I'm working on. Actually, I thought that may be the reason that it was failing, because I still have the Berkeley packages that came with RedHat (4.0.x) running side by side with the version I built myself (4.1.x). This has never created problems before in my other project that makes use of Berkeley. I thought about just doing an rpm --erase db4 db4-devel, but too much stuff depends on db4, and the API changed between 4.0 and 4.1.

    Any other ideas, or is there anything I can do to get more information that might help?

    Thanks for your help,

  • By the way, one of the big things that changed between Berkeley DB 4.0 and 4.1 was the open() call, which is what lead me to suspect a version mismatch.

  • mes
    mes California

    If you unset the LD_ASSUME_KERNEL environment variable, I'll bet that test will work fine. Of course, other Ice tests won't. ;)

    After looking into this issue, I discovered that BerkeleyDB (whichever version you use) must be configured on RH9 with the LD_ASSUME_KERNEL environment variable already set.

    I just built BerkeleyDB 4.1.25 on my RH9 box, but had forgotten to set the environment variable until after I had built and installed BerkeleyDB, and I encountered the same error message.

    This essentially rules out the use of the native BerkeleyDB that is included with RH9. The good news is that, after building BerkeleyDB with LD_ASSUME_KERNEL set to 2.4.1, the library seems to work fine with or without LD_ASSUME_KERNEL set for applications.

    We'll add a note about this issue to the INSTALL.LINUX file for the next release. Thanks for bringing this to our attention.

    - Mark
  • Ah, I see. Thanks for the info, I'll build a separate copy with that flag and stick it in /opt/db4_special, or something like that and let you know if I can get it to peacefully coexist.

  • bernard
    bernard Jupiter, FL
    I looked into this issue a little bit further: there is just one difference when you configure Berkeley DB with or without LD_ASSUME_KERNEL=2.4.1.

    With LD_ASSUME_KERNEL=2.4.1, configure outputs:
    > checking for mutexes ... x86/gcc-assembly

    Without (the default), configure outputs:
    > checking for mutexes ... POSIX/pthreads/library

    So the Berkeley DB that comes with RH9 (or that you build from scratch without worrying about LD_ASSUME_KERNEL) uses the POSIX library. Unfortunately Berkeley DB by default creates process-shared mutex and LinuxThreads does not implement pthread_mutexattr_setpshared( PTHREAD_PROCESS_SHARED ), which explains the failure. I verified all this with a debug Berkeley DB build.

    Fortunately there is a simple work-around: in Freeze, add DB_PRIVATE to the flags used to initialize the DB environment (see line 170 of src/Freeze/DBI.cpp). Then you can use a Berkeley DB built with POSIX mutexes.