Crash due to custom plugin?
Hi,
I am going crazy, because I am trying to build my plugin on Mac. First the source of the plugin works fine under Win and Linux! After several approaches I have put my plugin directly in the source tree of Qt Creator where all other plugins are and altered the plugins.pro. The plugin builds and is accessable also in the settings dialog, no problem so far.
BUT if I now wanted to open a file the program crashes:
Code:
0 libCppEditor.
dylib 0x1fe3328f CppEditor
::Internal::CppHighlighter::highlightBlock(QString const
&) + 911 1 QtGui 0x0036d518 QSyntaxHighlighterPrivate
::reformatBlock(QTextBlock) + 168 2 QtGui 0x0036d6e5 QSyntaxHighlighterPrivate::_q_reformatBlocks(int, int, int) + 293
5 QtGui 0x007a0e6a
QTextDocument::contentsChange(int,
int,
int) + 74 6 QtGui 0x0032e822 QTextDocumentPrivate::finishEdit() + 498
8 libTextEditor.
dylib 0x1fa03ea3 TextEditor
::BaseTextDocument::open(QString const
&) + 1651 9 libTextEditor.
dylib 0x1fa06908 TextEditor
::BaseTextEditor::open(QString const
&) + 40 10 libCppEditor.
dylib 0x1fe1fe6e CppEditor
::Internal::CPPEditorEditable::open(QString const
&) + 30 11 libCore.
dylib 0x1aae9b1e Core
::EditorManager::openEditor(Core
::Internal::EditorView*,
QString const
&,
QString const
&, QFlags<Core
::EditorManager::OpenEditorFlag>
) + 254 12 libCore.
dylib 0x1aae9dc6 Core
::EditorManager::openEditor(QString const
&,
QString const
&, QFlags<Core
::EditorManager::OpenEditorFlag>
) + 54 13 libProjectExplorer.
dylib 0x1fb29500 ProjectExplorer
::Internal::ProjectTreeWidget::openItem(QModelIndex const
&) + 160
Funny thing is: If I do not build my plugin, Qt Creator behaves normal, only if my plugin is in the .app then it chrashes. But I do not see any interaction with my plugin when it craches :eek:
Any hint is highly appreciated!
Thanks.
Modified plugins.pro:
Code:
# USE .subdir AND .depends !
# OTHERWISE PLUGINS WILL BUILD IN WRONG ORDER (DIRECTORIES ARE COMPILED IN PARALLEL)
TEMPLATE = subdirs
SUBDIRS = plugin_coreplugin \
[...]
plugin_asp \
debugger/dumper.pro
plugin_asp.subdir = asp
plugin_asp.depends += plugin_coreplugin
and the plugins pro:
Code:
TEMPLATE = lib
TARGET = ArtisticStylePlugin
include(../../qtcreatorplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
HEADERS = artisticstyleplugin.h \
artisticstyleiterator.h \
artisticstyleoptionpage.h \
artisticstyleoptionpagegui.h \
astyle/astyle.h \
artisticstyleconstants.h
SOURCES = artisticstyleplugin.cpp \
artisticstyleiterator.cpp \
artisticstyleoptionpage.cpp \
artisticstyleoptionpagegui.cpp \
astyle/ASFormatter.cpp \
astyle/ASBeautifier.cpp \
astyle/ASEnhancer.cpp \
astyle/ASResource.cpp
FORMS = artisticstyleoptionpagegui.ui
OTHER_FILES = ArtisticStylePlugin.pluginspec
Re: Crash due to custom plugin?
Does the plugin connect to some signals sent by the cpp editor or the code model? It seems the crash happens when there is a signal emitted by the code editor. Try disconnecting every connection from your plugin to the editor and see if it changes anything.
Re: Crash due to custom plugin?
Thanks, I totally skipped the initialize function, so my plugin does nothing. Opening a pro file works. But opening a cpp file, creator crashes? Will investigate the next days whats the error with cpp editor. Thanks.
Re: Crash due to custom plugin?
I think the crashing of QT is independent of your custom plugin.
I have a similar problem with QT Creator crashing. If I install QT on a specific Mac and simply open a project, then attempt to open either a header or cpp file, then QT Creator crashes. At first it happen when I was running the textfinder example, at the point where I connect a signal to a slot. But, then I narrowed it down to the opening of a header or cpp file. I get the same thread crashing as you do: libCppEditor.dylib. The Exception Type is EXC_BAD_ACCESS and Exception Code is KERN_PROTECTION_FAILURE.
The odd thing here is that I did the same install on a co-workers Mac who has a similar box, both of us running Snow Leopard on an iMac, and I can open the header and cpp files with no problem. The Xcode is 3.2 so that isn't the problem. The only difference that I can find in our two boxes is that my co-worker has 2 GB of RAM and I only have 1 GB. According to the QT website, 1 GB is sufficent.