Results 1 to 7 of 7

Thread: Segmentation Fault after plugin was unloaded

  1. #1
    Join Date
    May 2011
    Posts
    30
    Thanks
    1

    Default Re: Segmentation Fault after plugin was unloaded

    I have written application that manages plugins. When unload plugin by button click, everything is ok, debugger says that module is unloaded. Then I try to work in the program, just open standart open file dialog and it crashes at its exec() function. Debugger points at qmetaobject.h file. The error stays when I try to open other dialogs, my own dialogs.

    Does someone have any ideas about this error?


    Added after 1 14 minutes:


    Maybe, QPluginLoader unloads something else that is needed for application work. But debugger says nothing about that only that plugin dll was unloaded.
    Last edited by zzz9; 29th September 2011 at 17:56.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Segmentation Fault after plugin was unloaded

    Have you destroyed every object that used the plugin before you unloaded it? Are you holding pointers, now invalid, to anything in the unloaded plugin?

  3. #3
    Join Date
    May 2011
    Posts
    30
    Thanks
    1

    Default Re: Segmentation Fault after plugin was unloaded

    I've unloaded plugin just before doing something in the program, no objects were created. Moreover, QFileDialog doesn't deal with the plugin.
    I think it will be good idea to test qt plugin framework on a simple example, so I'll write about the result.

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

    Default Re: Segmentation Fault after plugin was unloaded

    What does your plugin do?
    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.


  5. #5
    Join Date
    May 2011
    Posts
    30
    Thanks
    1

    Default Re: Segmentation Fault after plugin was unloaded

    In simple applications everything works ok.

    What does your plugin do?
    Plugin creates a widget in a constructor. Application only tries to get plugin instance and add it to the list.

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

    Default Re: Segmentation Fault after plugin was unloaded

    Plugin shouldn't create any widgets in its constructor, you should have a separate method for that. Anyway... what does the plugin do in its destructor? Who is the parent of the widget? Does the widget get destroyed when the plugin is unloaded?
    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.


  7. #7
    Join Date
    May 2011
    Posts
    30
    Thanks
    1

    Default Re: Segmentation Fault after plugin was unloaded

    Quote Originally Posted by wysota View Post
    Plugin shouldn't create any widgets in its constructor, you should have a separate method for that. Anyway... what does the plugin do in its destructor? Who is the parent of the widget? Does the widget get destroyed when the plugin is unloaded?
    Destructor is empty. There is no parent for the widget when it is created, I add it into layout later. I destroy the widget before unloading.
    ... Just tried the program one more time with the new version of the plugin. Everything works fine. Thanks for replies.

Similar Threads

  1. segmentation fault!!
    By Yayati.Ekbote in forum Qt Programming
    Replies: 4
    Last Post: 24th March 2010, 15:10
  2. Plugin Segmentation fault
    By vieraci in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2009, 07:33
  3. segmentation fault
    By dreamer in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2008, 07:48
  4. Segmentation Fault?!
    By r07f1 in forum Newbie
    Replies: 2
    Last Post: 11th April 2008, 15:10
  5. segmentation fault
    By shamik in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2006, 07:33

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.