Bug 359685 - Kate SEGSIGV when trying to load the project plugin
Summary: Kate SEGSIGV when trying to load the project plugin
Status: RESOLVED DUPLICATE of bug 361517
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 23:13 UTC by Emmanuel Lepage Vallée
Modified: 2016-04-09 21:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Lepage Vallée 2016-02-22 23:13:08 UTC
I just upgraded my Gentoo system (latest GLibc, GCC) and Kate now crash on load.

This is due to the plugin system failing to load the project plugin. I looked around and no left-over file seem to be present. For now, I patched it using 

void KatePluginManager::loadPlugin(KatePluginInfo *item)
{
    /**
     * try to load the plugin
     */
if (item->saveName() != QLatin1String("kateprojectplugin"))
    item->load = (item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<KTextEditor::Plugin>(this, QVariantList() << item->saveName()));
    
    /**
     * tell the world about the success
     */
    if (item->plugin) {
       	emit KateApp::self()->wrapper()->pluginCreated(item->saveName(), item->plugin);
    }
}


Reproducible: Always

Steps to Reproduce:
1. Open Kate

Actual Results:  
segmentation fault

Expected Results:  
All plugins being loaded

CXXFLAGS="-fsanitize=undefined -fsanitize=address -fsanitize=leak -ggdb -O0" make -j && kate

kate: Last session is: ""
/var/tmp/portage/kde-apps/kate-15.08.3-r1/work/kate-15.08.3/kate/src/katepluginmanager.cpp:184:113: runtime error: member call on null pointer of type 'struct KPluginFactory'
/var/tmp/portage/kde-apps/kate-15.08.3-r1/work/kate-15.08.3/kate/src/katepluginmanager.cpp:184:113: runtime error: member access within null pointer of type 'struct KPluginFactory'
ASAN:SIGSEGV
=================================================================
==7352==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f8dacab6261 bp 0x7ffe652acc90 sp 0x7ffe652acc00 T0)
    #0 0x7f8dacab6260  (/usr/lib64/libkdeinit5_kate.so+0x532260)
    #1 0x7f8dacab4827  (/usr/lib64/libkdeinit5_kate.so+0x530827)
    #2 0x7f8dacb7a722 in KateSessionManager::loadSession(QExplicitlySharedDataPointer<KateSession> const&) const (/usr/lib64/libkdeinit5_kate.so+0x5f6722)
    #3 0x7f8dacb7a178 in KateSessionManager::activateSession(QExplicitlySharedDataPointer<KateSession>, bool, bool) (/usr/lib64/libkdeinit5_kate.so+0x5f6178)
    #4 0x7f8dacb7c1c0 in KateSessionManager::activateSession(QString const&, bool, bool) (/usr/lib64/libkdeinit5_kate.so+0x5f81c0)
    #5 0x7f8dacb7c349 in KateSessionManager::activateAnonymousSession() (/usr/lib64/libkdeinit5_kate.so+0x5f8349)
    #6 0x7f8dacb80623 in KateSessionManager::chooseSession() (/usr/lib64/libkdeinit5_kate.so+0x5fc623)
    #7 0x7f8dac9fea6b in KateApp::startupKate() (/usr/lib64/libkdeinit5_kate.so+0x47aa6b)
    #8 0x7f8dac9fbc6d in KateApp::init() (/usr/lib64/libkdeinit5_kate.so+0x477c6d)
    #9 0x7f8dacc0481d in kdemain (/usr/lib64/libkdeinit5_kate.so+0x68081d)
    #10 0x400969 in main (/usr/bin/kate+0x400969)
    #11 0x7f8dac20859f in __libc_start_main (/lib64/libc.so.6+0x2059f)
    #12 0x400848 in _start (/usr/bin/kate+0x400848)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 ??
==7352==ABORTING
Comment 1 Dominik Haumann 2016-04-05 19:06:17 UTC
Could you please provide a valgrind trace?
valgrind kate

This is most certainly an issue with your installation.
Comment 2 Emmanuel Lepage Vallée 2016-04-09 21:30:12 UTC

*** This bug has been marked as a duplicate of bug 361517 ***