I've run across a problem with RPM (as shipped with el6, appliest to Fedora and GIT tip as well), that's easily reproduced by repeatedly installing a package while repeatedly listing the list of installed packages. I was able to craft a minimal reproducer with rpmdb as small as a single package.

While tracking down the problem, I've attempted to mimic RPM's use of Berkeley DB, and the standalone reproducer exhibits the problem as well.

The crash reproducer code is available here:
http://v3.sk/~lkundrak/bdb-crash/

For failchk, you will need to specify pid/tid in DB_ENV->set_thread_id() and check them in DB_ENV->set_isalive(). Please refer to http://docs.oracle.com/cd/E17076_01/html/api_reference/C/envset_thread_id.html and http://docs.oracle.com/cd/E17076_01/html/api_reference/C/envset_isalive.html.

I was indeed missing the thread_id callback (and so is RPM).
Adding it (http://v3.sk/~lkundrak/bdb-crash/0001-Use-thread_id.patch) does not seem to fix the issue though -- Berkeley DB seems to use the actual PID with bogus TID if the callback is not specified, which works reasonably well as the application is single-threaded and is_alive callback only checks the PID.

What is the end goal that you are looking for? Are you looking to have you test pgm corrected so it works correctly, or are looking to figure what is possible incorrect in the RPM implementation? If for the RPM implementation, how is information going to be feed back to them.

user651890 wrote:
What is the end goal that you are looking for? Are you looking to have you test pgm corrected so it works correctly, or are looking to figure what is possible incorrect in the RPM implementation? If for the RPM implementation, how is information going to be feed back to them.

Exactly.

I guess I'll forward the fix to RPM in an usual way (GIT pull request).

This thread is a little unclear at the moment. Have the suggestions provided so far addressed the RPM implementation issue? I think GIT pull request is the best way to go to pass changes over to the RPM folks.