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

--- Comment #21 from ulte...@gmail.com ---
> OK, so the simplest crash fix is to add and check the QPointer guard. Can be 
> cherry-picked to the stable KDevelop branch. Would you like to create a merge 
> request with the fix?

I think you might be missing something here.


___


Made a little change to this code:

        if (menuGuard.isNull())
        {
                qDebug() << "Menu destroyed !! Returning...";
                return;
        }

____

Resultant output:

"2025-05-08T18:58:28.114"
KDevelop::TextDocument::createViewWidget(QWidget*)::<lambda()> Context menu
about to show
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
"2025-05-08T18:58:28.116"
KDevelop::TextDocument::createViewWidget(QWidget*)::<lambda()> Context menu
about to show
kdevplatform.shell: populateContextMenu() called while we still handled another
menu.
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
virtual void GitPlugin::additionalMenuEntries(QMenu*, const QList<QUrl>&)
Menu guarded
URLs be URL'ed
  Still exists --1 100515359718720
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
  stashes hashed
Menu exists
  Point --2 100515359718720
Complete
virtual void GitPlugin::additionalMenuEntries(QMenu*, const QList<QUrl>&)
Menu guarded
URLs be URL'ed
  Still exists --1 100515349942048
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
  stashes hashed
Menu destroyed !! Returning...
KCrash: Application 'kdevelop' crashing... crashRecursionCounter = 2
zsh: segmentation fault (core dumped)  ./bin/kdevelop

____

Unless the guard is supposed to be somewhere else, that I haven't realised.

For now, all the times I have tried (with minor variations here and there),
there has been no case where I prevented a crash after getting:
kdevplatform.shell: populateContextMenu() called while we still handled another
menu.

______

Thanks for the tip. I have been meaning to use the KDevelop debugging UI, just
never got to it.

As for this case, as I mentioned before:

The debugger breaks at:
kpluginfactory.h: function: template<typename T> inline T
*KPluginFactory::create(QObject *parent, const QVariantList &args)

And then gives a "Unable to continue debugged process". I see that in a message
box from QtCreator on trying to resume running. Meaning that I am unable to
reach the code in question, when using the debugger.

This happens despite me not seeing a signal (SEGV/ABRT etc), so I'll have to
check this one out first.

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

Reply via email to