Results 1 to 4 of 4

Thread: Crash due to custom plugin?

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default 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:
    Qt Code:
    1. 0 libCppEditor.dylib 0x1fe3328f CppEditor::Internal::CppHighlighter::highlightBlock(QString const&) + 911
    2. 1 QtGui 0x0036d518 QSyntaxHighlighterPrivate::reformatBlock(QTextBlock) + 168
    3. 2 QtGui 0x0036d6e5 QSyntaxHighlighterPrivate::_q_reformatBlocks(int, int, int) + 293
    4. 3 QtGui 0x0036dac9 QSyntaxHighlighter::qt_metacall(QMetaObject::Call, int, void**) + 201
    5. 4 QtCore 0x00da122a QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 538
    6. 5 QtGui 0x007a0e6a QTextDocument::contentsChange(int, int, int) + 74
    7. 6 QtGui 0x0032e822 QTextDocumentPrivate::finishEdit() + 498
    8. 7 QtGui 0x0031b4d5 QTextDocument::setPlainText(QString const&) + 101
    9. 8 libTextEditor.dylib 0x1fa03ea3 TextEditor::BaseTextDocument::open(QString const&) + 1651
    10. 9 libTextEditor.dylib 0x1fa06908 TextEditor::BaseTextEditor::open(QString const&) + 40
    11. 10 libCppEditor.dylib 0x1fe1fe6e CppEditor::Internal::CPPEditorEditable::open(QString const&) + 30
    12. 11 libCore.dylib 0x1aae9b1e Core::EditorManager::openEditor(Core::Internal::EditorView*, QString const&, QString const&, QFlags<Core::EditorManager::OpenEditorFlag>) + 254
    13. 12 libCore.dylib 0x1aae9dc6 Core::EditorManager::openEditor(QString const&, QString const&, QFlags<Core::EditorManager::OpenEditorFlag>) + 54
    14. 13 libProjectExplorer.dylib 0x1fb29500 ProjectExplorer::Internal::ProjectTreeWidget::openItem(QModelIndex const&) + 160
    To copy to clipboard, switch view to plain text mode 

    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

    Any hint is highly appreciated!

    Thanks.



    Modified plugins.pro:
    Qt Code:
    1. # USE .subdir AND .depends !
    2. # OTHERWISE PLUGINS WILL BUILD IN WRONG ORDER (DIRECTORIES ARE COMPILED IN PARALLEL)
    3.  
    4. TEMPLATE = subdirs
    5.  
    6. SUBDIRS = plugin_coreplugin \
    7. [...]
    8. plugin_asp \
    9. debugger/dumper.pro
    10.  
    11. plugin_asp.subdir = asp
    12. plugin_asp.depends += plugin_coreplugin
    To copy to clipboard, switch view to plain text mode 
    and the plugins pro:
    Qt Code:
    1. TEMPLATE = lib
    2. TARGET = ArtisticStylePlugin
    3.  
    4. include(../../qtcreatorplugin.pri)
    5. include(../../plugins/coreplugin/coreplugin.pri)
    6.  
    7. HEADERS = artisticstyleplugin.h \
    8. artisticstyleiterator.h \
    9. artisticstyleoptionpage.h \
    10. artisticstyleoptionpagegui.h \
    11. astyle/astyle.h \
    12. artisticstyleconstants.h
    13. SOURCES = artisticstyleplugin.cpp \
    14. artisticstyleiterator.cpp \
    15. artisticstyleoptionpage.cpp \
    16. artisticstyleoptionpagegui.cpp \
    17. astyle/ASFormatter.cpp \
    18. astyle/ASBeautifier.cpp \
    19. astyle/ASEnhancer.cpp \
    20. astyle/ASResource.cpp
    21. FORMS = artisticstyleoptionpagegui.ui
    22.  
    23. OTHER_FILES = ArtisticStylePlugin.pluginspec
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default 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.

  4. #4
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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.

Similar Threads

  1. Replies: 8
    Last Post: 27th December 2009, 14:57
  2. Custom Plugin Trouble
    By stevey in forum Qt Programming
    Replies: 5
    Last Post: 3rd November 2009, 17:08
  3. Replies: 2
    Last Post: 8th February 2008, 14:31
  4. Testing a custom Plugin
    By maluta in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2006, 15:09
  5. Custom plugin for a layout
    By cocheci in forum Qt Tools
    Replies: 2
    Last Post: 12th June 2006, 18:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.