crash on startup: duplicate GeoTagHandler registrations

Steven Robbins <[email protected]> Sat, 09 Mar 2024 21:26:56 -0600
Newsgroups gmane.comp.kde.digikam.devel
Message-ID <10775749.nUPlyArG6x@riemann>
Hi,

I pulled the current git sources to see how things are progressing.  Was able 
to build fine but it crashed immediately on startup due to the first assert in 
the following code:

void GeoTagHandler::registerHandler(const GeoParser::QualifiedName& qName, 
const GeoTagHandler* handler)
{
    qDebug() << "Inserting: " << qUtf8Printable(qName.first) << " / " << 
qUtf8Printable(qName.second);
    TagHash* hash = tagHandlerHash();
    Q_ASSERT(!hash->contains(qName));  <---- this one
    hash->insert(qName, handler);
    Q_ASSERT(hash->contains(qName));

#if DUMP_TAG_HANDLER_REGISTRATION > 0
    qCDebug(DIGIKAM_MARBLE_LOG) << "[GeoTagHandler] -> Recognizing" << 
qName.first << "tag with namespace" << qName.second;
#endif
}

The qDebug() code was put there by me to figure out that the duplicate is:

    address  /  http://earth.google.com/kml/2.0


This leads me to wonder: why the assert?  Is there any issue with either 
silently ignoring the second insert; or silently accepting the second insert, 
overwriting the first?

Notes: I'm building this on a Debian linux "sid"/"unstable" distribution, up 
to date as of today.  Building against Qt 5.15.10 (qtbase-opensource-src 
(5.15.10+dfsg-7)).

Thanks,
-Steve
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEy89k8fa3rclNjyokyeVeL63I9LkFAmXtKIAACgkQyeVeL63I
9LljGRAApF4ZOD+8/qOke2xlI1enL5ZAN/BSSoudCUTumlK9YWfUoWV1yRAbDhBE
vKYtyDVqM3HrhTsHCqYEWBLzibei3xxbhh6xCQj53WalEUKCkHxjvaiaT137bo12
1+4Q5dxxm5dzW9t4GxTWO6iARbkMxzXhmW4wcVUpcF/VxOMq/5NRXU2V5p81DrhU
CH4BrMEyJMIQ0QTzZoVapi2Ario8eO9q3USsngXN+4X6lXHY89dAmyc17H210s6j
W+Nm1lgS02e0cit397kXaQzAeUF/r4QLzjOxa7R3AMLfZ/cVtlujLNNOCENSfUwr
VqaWcTu6uTa2T6N5jTqtzIUB0ctT1FWRDf72DX7NfBUnSVCXI9NV0PnZIw598TNs
yZbG0kLw/zZOsXBjHmyccjj23RrBgLD9rBXlkqYy0Gx5BHOJkHmCf+BGW4k8TCdY
Lz7Z7vHN0an9NjawtzVuobbPpSOBzoLcmBcn0mLMB86HUbD5WQ195g6/qMm0uDom
VePAq2r8Z5Jqrn1pMsMQPrW3zR16gLa/cCEnTpQWycuzVFVV8r/0T8jYO55oCOJh
fqcYGtsYCwmOZ31Pxy8mL7wnKFVtAXkEPqEPf+QY91EdX7YR/s1MsoIRrfEOcy95
fRTolRbR7B3HTDFKoWX2g8p4AzbraGiF0o+EWac8WWB2GZa1PYc=
=LIVS
-----END PGP SIGNATURE-----