How to get Anki crash logs?

I’m developing an addon and after some iterations the Anki simply crashes without showing any errors. I tried to run viewing the console and no errors showing up also. The addon creates a dialog window with a web view and the crash occurs after around 20 iterations (record the voice, open dialog and close) or so.

Anki has crash logs? How can I access it?

    
    Anki 2.1.56 (07fd88dd) Python 3.9.15 Qt 6.4.0 PyQt 6.4.0
    Platform: Windows-10-10.0.22000
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2023-01-23 15:33:06
    
    
    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['ankipa', 0, 'None', '']
    Anki Zoom ['538879081', 2020-04-03T21:20, 'v1.1.3', '']
    AnkiConnect ['2055492159', 2022-09-18T21:11, 'None', '']
    AwesomeTTS - Add speech to your flashcards ['1436550454', 2023-01-13T00:54, 'None', '']
    Review Heatmap ['review_heatmap', 2020-04-30T10:23, 'None', '']
    
    ===IDs of active AnkiWeb add-ons===
    1436550454 2055492159 538879081
    
    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    

I don’t know if a frame list can be easily extracted on Windows, and it probably wouldn’t reveal much. The crash is likely in Qt, and if it’s happening when closing the dialog, there’s a good chance it’s caused by the PyQt objects being deallocated/garbage collected in an order that Qt doesn’t expect. Explicitly deleting (eg deleteLater()) certain child elements like the webview prior to closing the dialog may help.

I tried your suggestion and did’nt worked. I forgot to mention that the crash occurs when a new dialog is being opened. The dialog appears but without the webview and after some seconds Anki crashes. Is there a way to debug this?

I don’t think there’s any simple solution - it will likely require experimentation to figure what exactly causes the crash, then see if you can work around it somehow. If you can reproduce the issue outside of Anki and think it’s a bug, you can then try reproduce it outside of PyQt, and report the issue to PyQt or Qt as appropriate.