Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2022 13:19:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 261196] databases/db5: __db_pthread_mutex_lock fails with EINVAL on armv7
Message-ID:  <bug-261196-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261196

            Bug ID: 261196
           Summary: databases/db5: __db_pthread_mutex_lock fails with
                    EINVAL on armv7
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: mandree@FreeBSD.org
          Reporter: fuz@fuz.su
          Assignee: mandree@FreeBSD.org
             Flags: maintainer-feedback?(mandree@FreeBSD.org)

A build of mail/bogofilter (databases/db5 consumer) fails during the test s=
uite
with failure cause:

FAIL: t.probe
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

BDB2023 pthread lock failed: Invalid argument
BDB0061 PANIC: Invalid argument
BDB0060 PANIC: fatal region error detected; run recovery
bogofilter[5027]: DB_ENV->open, err: -30973, BDB0087 DB_RUNRECOVERY: Fatal
error, run database recovery
To recover, run: bogoutil -v --db-recover "./checks.4991.20220114T122654"
FAIL t.probe (exit status: 3)

This error seems to be produced by function __db_pthread_mutex_lock in
db-5.3.28/src/mutex/mut_pthread.c.  It appears that it only occurs when
building on armv7 (and possibly armv6 which I cannot test).

Unfortunately the db5 code is quite convoluted and I have not been able to
figure out what specific function has been called with an invalid argument.=
=20
Given that databases/db5 is subject to special treatment on armv6/armv7 (see
bug #197227), this latent issue might have been hidden on other architectur=
es.

If desired, I also volunteer to develop a patch to replace the SWP instruct=
ion
with modern exclusive loads/stores to avoid having to go through the pthrea=
ds
code path.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-261196-7788>