Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. advice on debugging bus error
Forum Updated to NodeBB v4.3 + New Features

advice on debugging bus error

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 609 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Miller
    wrote on last edited by
    #1

    Any suggestions of how to debug "bus error"?

    My python app had been working fine until I over tweaked something now I can't figure out wy I'm just getting "bus error"
    all of a sudden.

    I am starting the python script and it opens and it works for a few seconds until it fails with this:

    >  src/main.py
    2025-01-20 17:13:50.192 python[7514:326586] +[IMKClient subclass]: chose IMKClient_Modern
    2025-01-20 17:13:50.192 python[7514:326586] +[IMKInputSession subclass]: chose IMKInputSession_Modern
    [1]    7514 bus error  src/main.py
    

    Screen Shot 2025-01-20 at 17.17.27 PM.png

    I'm using Python 3.12.8 and QT 6.8.1 on a M2 Mac OSX Sequoia 15.2

    and my main.py begins with:

    import argparse
    from mainwindow import MainWindow
    
    def main():
        parser = argparse.ArgumentParser(description='Golf swing capture and analysis tool')
        parser.add_argument('-c' , '--config', help='Path to the config file.', default='src/config.yml')
        args = parser.parse_args()
        
        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
        mainWindow = MainWindow(args.config, roi_file, logger=logger)
        mainWindow.show()
        sys.exit(app.exec())
    
    if __name__ == "__main__":
         main()
    

    and my mainwindow.py is

    class MainWindow(QMainWindow):
        def __init__(self, config_file, roi_file, logger):
            super().__init__()
            self.logger = logger
            self.config_file = config_file
            self.roi_file = roi_file
    
        # ..........
    
    Pl45m4P 1 Reply Last reply
    0
    • A Alan Miller

      Any suggestions of how to debug "bus error"?

      My python app had been working fine until I over tweaked something now I can't figure out wy I'm just getting "bus error"
      all of a sudden.

      I am starting the python script and it opens and it works for a few seconds until it fails with this:

      >  src/main.py
      2025-01-20 17:13:50.192 python[7514:326586] +[IMKClient subclass]: chose IMKClient_Modern
      2025-01-20 17:13:50.192 python[7514:326586] +[IMKInputSession subclass]: chose IMKInputSession_Modern
      [1]    7514 bus error  src/main.py
      

      Screen Shot 2025-01-20 at 17.17.27 PM.png

      I'm using Python 3.12.8 and QT 6.8.1 on a M2 Mac OSX Sequoia 15.2

      and my main.py begins with:

      import argparse
      from mainwindow import MainWindow
      
      def main():
          parser = argparse.ArgumentParser(description='Golf swing capture and analysis tool')
          parser.add_argument('-c' , '--config', help='Path to the config file.', default='src/config.yml')
          args = parser.parse_args()
          
          app = QApplication.instance()
          if app is None:
              app = QApplication(sys.argv)
          mainWindow = MainWindow(args.config, roi_file, logger=logger)
          mainWindow.show()
          sys.exit(app.exec())
      
      if __name__ == "__main__":
           main()
      

      and my mainwindow.py is

      class MainWindow(QMainWindow):
          def __init__(self, config_file, roi_file, logger):
              super().__init__()
              self.logger = logger
              self.config_file = config_file
              self.roi_file = roi_file
      
          # ..........
      
      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Alan-Miller

      Hi, don't have the ultimate solution right now as "bus error" could originate from anywhere in your code (I assume not the parts you are showing), but when searching for the message before the crash you find posts like this one

      • https://github.com/dotnet/maui/issues/24794

      Seems to be related to Sequoia and Python (and seem to have an impact on many libraries/apps, not only Qt).
      In general bus error could be caused by a wrong memory layout or trying to access non-readable data...

      Does it happen every time for sure or just randomly from time to time?!
      If you made changes recently and that has never happened before, you could try to remove/comment parts of your code until everything is stable again. Them you know at least what causes the crash.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      A 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @Alan-Miller

        Hi, don't have the ultimate solution right now as "bus error" could originate from anywhere in your code (I assume not the parts you are showing), but when searching for the message before the crash you find posts like this one

        • https://github.com/dotnet/maui/issues/24794

        Seems to be related to Sequoia and Python (and seem to have an impact on many libraries/apps, not only Qt).
        In general bus error could be caused by a wrong memory layout or trying to access non-readable data...

        Does it happen every time for sure or just randomly from time to time?!
        If you made changes recently and that has never happened before, you could try to remove/comment parts of your code until everything is stable again. Them you know at least what causes the crash.

        A Offline
        A Offline
        Alan Miller
        wrote on last edited by
        #3

        Thanks @Pl45m4 Ouch! I KNEW I shouldn't have upgraded yesterday, I didn't even want the Apple Intelligence crap.

        Yes, I see lots of similar posts now.

        I was trying to get all my widgets packed as tight as I can and I was adjusting the padding/margins/geometries of all the widgets but I just can't figure out how to get rid of the space above/below the 2 toolbars in this custom TabWidget I created.

        For me the crash is random, sometimes within seconds, other times up to a few minutes.

        img.png

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved