airbnb / airbnb/MagazineLayout
EXC_BAD_ACCESS during drag and drop in Magazine layout
- Dominant language
- Swift
- Stars
- 3.4k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
I am using MagazineLayout in my project, and I encountered a consistent crash when performing drag-and-drop operations. The error message is:
EXC_BAD_ACCESS (code=2, address=0x...)
It seems like the issue is related to layout attributes being deallocated during the drag-and-drop process. Specifically, this crash occurs when super.systemLayoutSizeFitting is called, which indicates that some objects are being deallocated unexpectedly during layout calculations or while updating the layout.
Here’s a bit more context:
• The crash happens during drag-and-drop interactions, where items are moved around in the collection view.
• I suspect that the layout attributes or other critical layout-related objects are being deallocated during the drag-and-drop process.
• I am using the latest version of MagazineLayout implementation.
Could this be related to how MagazineLayout handles layout invalidation or the recycling of layout attributes during drag-and-drop?
Please let me know if you need more details or steps to reproduce this issue. I would appreciate any guidance or fixes regarding this problem.
version: iOS 17 (simulator and device)
Thank you for your time and help!
Contributor guide
Research direction
Start by reproducing the crash during collection-view drag-and-drop on iOS 17, focusing on the call to super.systemLayoutSizeFitting. Inspect MagazineLayout's layout invalidation and layout-attribute recycling during item moves. Done means identifying and fixing the deallocation causing EXC_BAD_ACCESS, with a reliable reproduction confirming the crash no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100