Saturday, February 10, 2024

WSPR Watch 4.10 - fixed a long standing thread crash

WSPR Watch, my iOS app for quickly looking at spots on WSPRnet, is 12 years old. During that time it has been updated as the software tools and frameworks have changed.

First it was Objective C and UIKit. Next came the move to Swift. Version 4 was a move to SwiftUI.

I've always used background threads for doing the time-consuming requests to the different data sources. Most recently I've been using async/await and Actors. 

When I moved the app from storyboards to SwiftUI about half of the old code was no longer required. Things look much neater now. For a long time I've had a few crash reports coming in. These have been mostly in the map view. This app really hammers the map by drawing, sometimes, 10,000 or more overlays on it. 

I'd heard of the ThreadSanitiser that is part of the LLVM toolchain and available in Xcode. When I turned it on and ran the app in a Simulator it quickly showed me three data races that I hadn't noticed. My mistake was adding to an Array from a background thread when that Array was also available from other threads.

Having fixed these, I am now seeing zero crashes from users of version 4.9 and later. I expect to see a few due to being out of memory of killed in other ways but so far it looks good.

My thanks, as always, to my wonderful testers and users for their suggestions.


走啊走 said...

Hi Peter,

Thank you for the wonderful app. One feature I like the most is "Generate WSPR", it allows me to transmit WSPR with any SSB capable rigs easily. Do you have to plan to add "WSPR decoding" as well, I'm asking because it will be useful when internet is not available.


Peter Marks said...

Hi Wei,

Yes, decode would be an interesting feature. I would favour splitting encode and decode out to a separate mini app as I think they are a different use case to the display of data which is what WSPR watch is mostly about.

Thank you for your feedback.

73, Peter, VK3TPM