Trouble porting Qt5 addon to Qt6

I’ve been developing an addon this year in Qt5, and with the new 2.1.55 updating pushing Mac users to Qt6 it’s revealed a “game-breaking”\ compatibility issue in my code that I’m unsure how to troubleshoot.

On Qt6 in both 2.1.54 and 2.1.55, Anki will crash with no error or cmd line output when the Qt window associated with my addon is opened. This happens on PC and Mac, meanwhile it continues to work as intended in 2.1.54 and 2.1.55 on Qt5.

This has been almost impossible to troubleshoot, as there is no error text to investigate and the window simply closes. I’ve spent a few hours googling to no avail.

This might be too vague for anyone to offer any input, and my addon has a few thousand lines of code so it’s hard to share any specifics here in a meaningful way, but I’m wondering if anyone can offer any thoughts if this type of crash is common, or if there is another place I can look to investigate where the friction point is.

Edit: Immediately after posting this, I found the CrashDumps folder for Anki that shows it throwing Exception 0xC0000005, “The thread tried to read from or write to a virtual address for which it does not have the appropriate access.” Guess I’ll have to dig into how to analyze these files more meaningfully but I’m rather confused where this would be coming from. Again, wondering if this is a common error I haven’t been unable to unearth.

Thanks, appreciate any insight!

This looks like a generic (Windows?) error. I think you’ll get more people willing to help if you share the source code of your add-on.

I’ve uploaded some anki add-ons. I’ve seen maybe ~3-5 reports about full anki crashes with qt6 caused by my add-ons, but I think they were for MacOS. Here’s one I remember: [Bug] Crashes Anki on macOS when trying to commit html changes. · Issue #6 · ijgnd/anki__editor_edit_html_extended · GitHub

The line apparently triggering the crash looks harmless to me.

I wonder how this line was identified. Maybe by brute-forcing it by disabling 50% of the code, adding some lines with print() and running it again, and then another 50% of the remaining part and so on?

1 Like

Yeah from reading a crash report one of my Mac users sent me + the .dmp on my end when I replicate on Windows it seems to be a generic segfault. Considered sharing the github but didn’t think anyone wanted to wade through 1k lines of my garbage code so figured I’d fish for any general triggers.

As ijgnd suggested, not sure how to troubleshoot without brute force but that might be what I have to do! Appreciate the input all

A post was split to a new topic: Leaderboard add-on issue