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

JATothrim <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/kdev
                   |                            |elop/kdev-python/-/commit/4
                   |                            |9cc1d9606be9ec4c33c169111f2
                   |                            |1903c734bf7f
            Version|                            |6.0.251201
  Fixed/Implemented|                            |
                 In|                            |

--- Comment #4 from JATothrim <[email protected]> ---
Git commit 49cc1d9606be9ec4c33c169111f21903c734bf7f by Jarmo Tiitto.
Committed on 17/12/2025 at 18:39.
Pushed by brauch into branch 'master'.

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

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

https://invent.kde.org/kdevelop/kdev-python/-/commit/49cc1d9606be9ec4c33c169111f21903c734bf7f

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

Reply via email to