dbenv->open: Invalid argument , can not build Berkeley DB in RedHat Linux with --enable-posixmutexes

Posted on 2003-11-16
Last Modified: 2010-04-29
Hi ,
I built Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 (Tampa)
Kernel 2.4.9-e.12smp on an i686 .I installed gcc-3.2.3 , glibc-2.3.2 on this machine.
I use autoconfig as follow:
../dist/configure --prefix=/export/home/build/cal-5.1.0

When I run my program , I got this messsge:
dbenv->open: Invalid argument

If i don't use autoconfig with --enable-posixmutexes option , my program can run ok , but there are 4 child process running with my program 's process .
I want to know if I can build Berkeley DB 4.0 in Red Hat Enterprise Linux WS release 2.1 with pthread library support or not .
Thank you very much.
Question by:honguyenbinh
  • 2

Accepted Solution

g0rath earned 50 total points
ID: 9771384
To force Berkeley DB to use the POSIX pthread mutex interfaces for underlying mutex support, enter --enable-posixmutexes as an argument to configure. This is rarely necessary: POSIX mutexes will be selected automatically on systems where they are the preferred implementation.
The --enable-posixmutexes configuration argument is normally used in two ways: First, when there are multiple mutex implementations available and the POSIX mutex implementation is not the preferred one (for example, on Solaris where the LWP mutexes are used by default). Second, by default the Berkeley DB library will only select the POSIX mutex implementation if it supports mutexes shared between multiple processes, as described for the pthread_condattr_setpshared and pthread_mutexattr_setpshared interfaces. The --enable-posixmutexes configuration argument can be used to force the selection of POSIX mutexes in this case, which can improve application performance significantly when the alternative mutex implementation is a non-blocking one (for example test-and-set assembly instructions). However, configuring to use POSIX mutexes when the implementation does not have inter-process support will only allow the creation of private database environments, that is, environments where the DB_PRIVATE flag is specified to the DB_ENV->open method.

Specifying the --enable-posixmutexes configuration argument may require that Berkeley DB be linked with the -lpthread library.


Linux does not support the pthread_*attr_setpshared() function, and it appears that the rpms disable this option, and your are forcing this option....what happens that if you attempt to run this, it will return the error ENOSYS

Some rpms in their changelogs say they enable this and later disable this

Expert Comment

ID: 9771444
If you want to see if there is a patch to allow would have to see what the Redhat people do
You may want to download the latest source rpm from rpmfind, and then take a look at their patches.


rpm -ivh whatever.src.rpm

cd /usr/src/redhat

.../SOURCES - should have the patches
.../BUILD - will have the build directory
.../SPECS - will have the template that shows all the patches applied.

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question