advice on debugging bus error
-
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
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 # ..........
-
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
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. -
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.