Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on a SwiftUI app when scrolling a List on macOS Sequoia #2363

Open
marcosatanaka opened this issue Feb 21, 2025 · 1 comment
Open

Crash on a SwiftUI app when scrolling a List on macOS Sequoia #2363

marcosatanaka opened this issue Feb 21, 2025 · 1 comment

Comments

@marcosatanaka
Copy link

Kingfisher causes a SwiftUI app to crash when scrolling a List by clicking the scroll bar on macOS Sequoia. I’ve created a sample project that demonstrates the issue and I’m also attaching a screen recording. The crash stops when we remove KFImage from the list’s cells.

No outputs are printed to the console when it crashes; only this error is shown:

Thread 1: EXC_BAD_ACCESS (code=1, address=0x43938ef28660)
A bad access to memory terminated the process.

Steps to Reproduce

  1. Download the attached Xcode project, open it, and launch the app.
  2. Scroll down the list to reveal the scroll bar.
  3. Move your mouse cursor to the scroll bar and click it to quickly scroll to the selected location.
  4. The app crashes.

System Info

  • macOS Sequoia 15.3 (24D60)
  • Xcode 16.2 (16C5032a)
  • Kingfisher 8.2.0
  • SwiftUI life cycle app for macOS

Stack trace

Image

KingfisherTest.zip

Screen Recording 2025-02-21 at 12.28.21.mov.zip

@onevcat
Copy link
Owner

onevcat commented Feb 22, 2025

Thanks for reporting this.

I found that the crash will not happen if you do not wrap the cell in a NavigationLink, say like this in the ContentView would solve this issue:

    ForEach(Data.urls, id: \.self) { item in
//     NavigationLink(value: item) {
           CellView(thumbnailURL: item)
//     }
    }

Since the crash stack only includes the SwiftUI Attributed Graph and not Kingfisher, I suspect the issue lies within SwiftUI, possibly related to bad memory access. I’ll investigate further to identify the root cause, but fixes in Kingfisher would likely only serve as workarounds rather than addressing the core problem. It might also be worth reporting this to Apple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants