Mailing List Archive

Problems with [Q]GpgME and Qt6
(Crossposting to Qt Forum)
I have an app that works fine in Qt5. I use QGpgME to encrypt/decrypt
messages and handle key usage. I'm trying to upgrade the app to Qt6, and,
naturally, expected problems, but this one beats me.
Here, for example, is the code I use to retrieve my secret key list:
QGpgME::KeyListJob *job = QGpgME::openpgp()->keyListJob(false, false,
false);
// Prepare result vector
std::vector<GpgME::Key> keys;
// Execute it synchronously
GpgME::KeyListResult result = job->exec(QStringList() <<
QStringLiteral(""), // No pattern: get all
true, keys); // Only secret keys
delete job;
Now, this is straight out of the "t-keylist.cpp" test file that comes with
the GpgME source. It works perfectly well under Qt5. but under Qt6, it
segfaults at the "job->exec" line.
Anyone have a clue why it crashes under Qt6?
Thanks,
--
Ron Murray <rjmx@rjmx.net <mailto:rjmx@rjmx.net> >
PGP Fingerprint: 4D99 70E3 2317 334B 141E 7B63 12F7 E865 B5E2 E761
Re: Problems with [Q]GpgME and Qt6 [ In reply to ]
On Samstag, 25. November 2023 04:15:28 CET Ron Murray via Gnupg-users wrote:
> Here, for example, is the code I use to retrieve my secret key list:
> QGpgME::KeyListJob *job = QGpgME::openpgp()->keyListJob(false, false,
> false);
> // Prepare result vector
> std::vector<GpgME::Key> keys;
> // Execute it synchronously
> GpgME::KeyListResult result = job->exec(QStringList() <<
> QStringLiteral(""), // No pattern: get all
> true, keys); // Only secret keys
> delete job;
> Now, this is straight out of the "t-keylist.cpp" test file that comes with
> the GpgME source. It works perfectly well under Qt5. but under Qt6, it
> segfaults at the "job->exec" line.
> Anyone have a clue why it crashes under Qt6?

I cannot reproduce this on openSUSE Tumbleweed with Qt 6.6.0. I changed the
`job->exec` call in t-keylist.cpp as above. This makes the test fail (because
the assertion is no longer true), but it doesn't crash. It would help if you'd
give us a backtrace of the segfault.

Regards,
Ingo