Repository navigation
Fix a crash adding several files at once, from #535 - #536
Merged
Merged
Conversation
… urlForPath:] The C function urlForPath() went with the rest of PlaylistEntry's URL code to CogPlaylist in 2f51353, but PlaylistLoader and SQLiteStore declared it themselves and still called it. The app links with -undefined dynamic_lookup, so the build passed, and the call failed when it was reached: loading metadata in the background, as adding several files at once does, aborted the app, as would SQLiteStore's import of the old library. The Swift port of it is now visible to Objective-C as +[PlaylistEntry urlForPath:], and both call it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#535 moved the C function
urlForPath()fromPlaylistEntry.minto CogPlaylist, as the SwiftPlaylistEntry.url(forPath:). But two files declared the C function themselves and still called it:PlaylistLoader.m, inloadInfoForEntries:;SQLiteStore.m, in its import of the old library.The Cog target links with
-undefined dynamic_lookup, so the build passed. The call fails only when it's reached, and dyld aborts the app.loadInfoForEntries:is the background metadata load: adding several files at once loads the first in the foreground and the rest there, so adding more than one file at a time crashesmaintoday. My testing of #535 added files one at a time and from cue sheets, neither of which reaches it. Sorry about that.The fix exposes the Swift version to Objective-C as
+[PlaylistEntry urlForPath:]; both callers use it, and the stale declarations go.Testing
nm -uonCog.debug.dylibno longer lists_urlForPath.PlaylistEntryandPlaylistStore's classes, andCogPlaylist.frameworkexports both. Nothing else dangles.urlForPath:the way Objective-C does. All 28 CogPlaylist tests pass.🤖 Generated with Claude Code