[Interest] can the QRegExpEngine cache acces objects belonging to an unloaded library during global destruction?

René J.V. Bertin rjvbertin at gmail.com
Mon Jan 29 19:24:06 CET 2018


>Don't use QStringLiteral with QRegExp, specially in plugins you'll 
>See https://blogs.kde.org/2015/11/05/qregexp-qstringliteral-crash-exit

The backtrace there certainly looks familiar. The mentioned fix (in 5.6) was to stop unloading plugins, a principle that's clearly not being applied here. I'm running Qt 5.9.3 here, and am *almost* certain I never saw the issue in 5.8.0 (but have yet to compare the relevant qfactory*.cpp files).

What bothers me here is that the explanation suggests that it doesn't matter if you do `QRegExp(QStringLiteral("foo"))` or if there are 27 intermediate variables and function arguments between the QRegExp and the QStringLiteral. I hope that's me misunderstanding because otherwise we almost have to drop the NO_CAST_FROM_ASCII build option; KIO use a *lot* of QRegExp instances I noticed, and the code is evidently littered with QStringLiterals.


More information about the Interest mailing list