DragonFlyBSD / DPorts

The dedicated application build system for DragonFly BSD
Other
89 stars 45 forks source link

bdb-4.8 broken: "unable to initialize mutex" #75

Closed ftigeot closed 10 years ago

ftigeot commented 10 years ago

bdb-4.8 is unable to run properly on DragonFly 3.7 and reports "unable to initialize mutex"

This could be caused by some unsupported pthread (or other threading implementation) operation

Configure output: "checking for mutexes... POSIX/pthreads/x86_64/gcc-assembly"

ftigeot commented 10 years ago

This error is caused by a pthread_mutexattr_setpshared() call returning EINVAL.

The bdb code calling it is in a conditionally compiled section and not used on FreeBSD. Configure changes between FreeBSD (-) and DragonFly(+):

-/* #undef HAVE_MUTEX_HYBRID */ +#define HAVE_MUTEX_HYBRID 1

-/* #undef HAVE_MUTEX_PTHREADS */ +#define HAVE_MUTEX_PTHREADS 1

-#define HAVE_SHMCTL_SHM_LOCK 1 +/* #undef HAVE_SHMCTL_SHM_LOCK */

ftigeot commented 10 years ago

Another option would be for the configure script to set HAVE_MUTEX_THREAD_ONLY in build_unix/db_config.h

ftigeot commented 10 years ago

Forcing configure to use the right mutex code is enough to fix this package. One of --with-mutex=x86/gcc-assembly or --with-mutex=x86_64/gcc-assembly can be used depending on the target architecture. --with-mutex=x86_64/gcc-assembly is what the configure script autodetects on FreeBSD/amd64.

ftigeot commented 10 years ago

Please push this content in a Makefile.DragonFly file:

.if ${ARCH} == "i386" CONFIGURE_ARGS+= --with-mutex=x86/gcc-assembly .else CONFIGURE_ARGS+= --with-mutex=x86_64/gcc-assembly .endif

jrmarino commented 10 years ago

Okay, the equivalent of that was added here: https://github.com/DragonFlyBSD/DPorts/commit/564533f8e9f814eddfb95dbbcf8dc35420a66487

Two thoughts: 1) Are db47 and below affected and need same fix? 2) There is movement to remove all db4X and make all ports use db5.0. Seems like a mess is brewing.

ftigeot commented 10 years ago

On Sun, Dec 29, 2013 at 07:19:34AM -0800, jrmarino wrote:

Okay, the equivalent of that was added here: https://github.com/DragonFlyBSD/DPorts/commit/564533f8e9f814eddfb95dbbcf8dc35420a66487

Two thoughts: 1) Are db47 and below affected and need same fix?

db47 is affected: slapd also dies with the "unable to initialize mutex: Invalid argument" error

I'm not sure about other versions yet; I'll try to test them all one by one but this will take time

Francois Tigeot

ftigeot commented 10 years ago

Almost all db4* versions and db5 configure themselves wrongly. I couldn't check db43 and previous versions as well as db6 with openldap24-server. Only db46 is fine so far.

jrmarino commented 10 years ago

so we need to update: databases/db4 databases/db41 databases/db42 databases/db43 (unconfirmed) databases/db44 databases/db47 databases/db5 ?

ftigeot commented 10 years ago

db44, db47 and db5 are definitely broken. I couldn't test db4 to db43.

jrmarino commented 10 years ago

ok, I set db4-43 as mutex x86/gcc-assembly (they were pre-x86-64 support) and db44, 47, and 5 just like I set db48. available in latest dports. Untested of course.