https://bugs.kde.org/show_bug.cgi?id=513423

Igor Kushnir <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/kdev |https://invent.kde.org/kdev
                   |elop/kdev-python/-/commit/4 |elop/kdev-python/-/commit/3
                   |9cc1d9606be9ec4c33c169111f2 |4619137263acd0d2d65a8eb92f4
                   |1903c734bf7f                |7d7231718457

--- Comment #5 from Igor Kushnir <[email protected]> ---
Git commit 34619137263acd0d2d65a8eb92f47d7231718457 by Igor Kushnir, on behalf
of Jarmo Tiitto.
Committed on 18/12/2025 at 16:53.
Pushed by igorkushnir into branch 'release/25.12'.

kdevpdb: fix a crash caused by a localization mismatch

It turns out that KDevelop's and kdevpdb's i18n() translated strings can
mismatch. The VariableController::fetch*() methods pass a seemingly
translated string to the enumerateNamespace() method, which assigns it
to a Namespace instance. This string is then passed to the
variableCollection()->locals() call to access the KDevelop::Locals
instances that have already been initialized. Locals::updateLocals()
then calls createVariable(), which either aborts or crashes because it
cannot find the index of the i18n("Locals") named section of the
KDevelop::Locals instance in the m_collections array.

The crash or Q_ASSERT() failure occurred because the i18n("Locals")
resulted in an untranslated string within the plugin. However, on the
KDevelop side, the string was translated, resulting in a mismatch.
Therefore, KDevelop::VariableCollection::locals(ns->name) returned a
new, unrelated KDevelop::Locals instance, and our createVariable()
cannot find an index for it.

This can be fixed by storing a pointer to the KDevelop::Locals instance
in the Namespace struct instead, and using this member to call
updateLocals(). This resolves the crash because a Locals instance from
the m_collections array is now guaranteed to be used. The last parameter
of enumerateNamespace() is therefore redundant and has been removed. The
less important qCDebug(KDEV_PYTHON_VARIABLECONTROLLER) debug print
statement has been modified so that this fix can be implemented.
FIXED-IN: 6.0.251201
(cherry picked from commit 49cc1d9606be9ec4c33c169111f21903c734bf7f)

M  +11   -9    debugger/variablecontroller.cpp
M  +7    -2    debugger/variablecontroller.h

https://invent.kde.org/kdevelop/kdev-python/-/commit/34619137263acd0d2d65a8eb92f47d7231718457

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to