Results 1 to 2 of 2

Thread: [PyQt4] Segmentation fault on Qthread

  1. #1
    Join Date
    Apr 2014
    Posts
    1
    Qt products

    Default [PyQt4] Segmentation fault on Qthread

    My systray app, sometimes, crash when a thread is started.
    The error is: Segmentation fault (core dumped)

    Worker:
    class ServerFinder(QtCore.QObject):

    server_founded = QtCore.pyqtSignal(str, str)
    no_server_founded = QtCore.pyqtSignal()
    finished = QtCore.pyqtSignal()

    @QtCore.pyqtSlot()
    def execute(self):
    """Worker"""
    print 'run()'
    service = discod_api.ServerDisco()
    #result = service.new_query("updrive-request")
    result = service.new_query("updrive-request-fabre")
    if result is None:
    self.no_server_founded.emit()
    else:
    self.ip = str(result[0])
    self.port = str(result[1])
    self.server_founded.emit(self.ip, self.port)
    self.finished.emit()
    print 'end - run()'


    Code that starts thread:

    self.finder = ServerFinder()
    self.finder.moveToThread(self.obj_thread)
    self.finder.server_founded.connect(self.server_fou nd)
    self.finder.no_server_founded.connect(self.no_serv er_found)
    self.obj_thread.started.connect(self.finder.execut e)
    self.finder.finished.connect(self.obj_thread.quit)
    #obj_thread.finished.connect(app.exit)
    self.obj_thread.start()

  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: [PyQt4] Segmentation fault on Qthread

    Please edit your post and put the code in [code][/code] tags.

    Tell us why you think this crash has anything to do with the code you presented. Where does the program crash when you run it in the Python debugger etc.

Similar Threads

  1. Segmentation Fault
    By Ryan Riffle in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2011, 20:52
  2. Segmentation Fault
    By freekill in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2010, 15:31
  3. Segmentation fault
    By impeteperry in forum Qt Programming
    Replies: 5
    Last Post: 29th December 2008, 18:59
  4. segmentation fault
    By mattia in forum Newbie
    Replies: 22
    Last Post: 7th November 2007, 10:37
  5. (Another) segmentation fault
    By Lebowski in forum Qt Programming
    Replies: 27
    Last Post: 6th April 2006, 06: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.