Closed Alessandro1970 closed 5 years ago
Hmmm, I didn't manage to reproduce that. Does it occur all the time on your machine or only with a specific D64 image? 🤔
No, it hangs with .d64 , .crt ...with all files. In this example I tried to load logo.d64 from the desktop: report2.txt.zip
This problem occurs with VirtualC64 alpha 3 and alpha 4 If I use 3.1.1 or 3.0.1 version it doesn't happen
It crashes on my mac too. (alpha 4)
If "Open" is selected from menu and than you try to load a .d64, a .crt or a .tap image VirtualC64 (alpha 4) quit immediatly.
It crashes on my MBP too (the version 3.1.1 worked fine, it is something changed in the alpha, I do not remeber alpha2 but alpha 3 and 4 crash)
Found it. When the emulator starts, macOS calls the following methods (besides others):
awakeFromNib()
windowDidLoad()
windowDidBecomeMain()
Originally, the AudioEngine was initialized in windowDidLoad and used in windowDidBecomeMain. However, it seems that the function order may vary. I.e., if a second window opens, the following order is possible:
awakeFromNib()
windowDidBecomeMain()
windowDidLoad()
Hence, the AudioEngine is used before it is initialized which crashes the emulator.
It didn't crash in 3.1.1, because AudioEngine initialization was still implemented in Objective-C. I notices that a couple of weeks ago and migrated it to Swift (with the bug included).
I've moved to initialization to awakeFromNib() which seems to a safe place. The crash should be gone in alpha 5:
http://www.dirkwhoffmann.de/virtualc64/VirtualC64_3.2alpha5.zip
BTW, I assembled together a small tutorial how to get debug information in Xcode when the emulator crashes. Sometimes (as in this case), the crash report alone does not contain enough information to debug. The tutorial (which shows how to debug the bug we're talking about) is available on GitQ in the forum:
https://gitq.com/dirkwhoffmann/virtualc64/topics/8/how-do-i-report-a-crash
If you are eager to walk through the tutorial and think that it's not clear enough at some point, please let me know.
Hi, if I try to open a disk image from the menu (FILE --> OPEN --> .d64 image) the VirtualC64 crashes.
This is the report of the crash : report.txt.zip