I'm currently in the process of fixing kleopatra's unit test suite. There is one
failing test that randomly fails with assertions in gpgme while running many
threaded keylistings and verify jobs.
To rule out that kleopatra or gpgme do something unsupported in their jobs I've
wrote a test for plain gpgme that duplicated the behavior.
First I just started 500 verify jobs this worked. So I added the mixed keylist /
verify mode that the kleopatra test used and this started to trigger bugs.
With a modified version that only does a keylist I can still trigger this but It
felt like more rarely and I never saw the io_select with that test. So I've
added both here.
The tests are quite aggressive with 500 threads I'm running them on an Intel
Core I7 2600k and they take quite a while. (Be sure to run them with nice)
I don't propose to add them to the regression test suite for the same reason ;-)
Here is an example of the errors I saw (running the tests ~10 times)
The most regular assertion is:
t-thread-keylist: wait.c:204: _gpgme_run_io_cb: Assertion `nr <= 1' failed.
But you can also get:
t-thread-keylist-verify: posix-io.c:563: _gpgme_io_select: Assertion
`!((((&writefds)->fds_bits)[((fds[i].fd) / (8 * (int) sizeof (fd_mask)))] &
((fd_mask) 1 << ((fds[i].fd) % (8 * (int) sizeof (__fd_mask))))) != 0)' failed.
And segfaults in both tests.
Segmentation fault nice ./t-thread-keylist
Segmentation fault nice ./t-thread-keylist-verify
The keylist test also hang twice until I kill it after some minutes.