ReactiveCocoa / ReactiveSwift

Streams of values over time
MIT License
3.01k stars 433 forks source link

EXC_BAD_ACCESS Crashes occur in xcode15 #879

Closed eunyongeom closed 1 year ago

eunyongeom commented 1 year ago

After updating to xcode15, the following crashes occur. Due to these problems, I am unable to update to xcode15. I would greatly appreciate your help.

  1. duringLifetimeOf crash

    extension Signal {
    /// Forward events from `self` until `object` deinitializes, at which point the
    /// returned signal will complete.
    ///
    /// - parameters:
    ///   - object: An object of which the deinitialization would complete the returned
    ///             `Signal`. Both Objective-C and native Swift objects are supported.
    ///
    /// - returns: A signal that will deliver events until `object` deinitializes.
    public func take(duringLifetimeOf object: AnyObject) -> Signal<Value, Error> {
        return take(during: Lifetime.of(object))
    }
    }
    Screenshot 2023-10-05 at 11 40 07 PM
  2. tryToDisposeSilentlyIfQualified crash

    Screenshot 2023-10-07 at 1 25 52 PM
eunyongeom commented 1 year ago

I think the problem occurred because I built it incorrectly. After rebuilding it, the crash problem went away.

mluisbrown commented 1 year ago

Thanks for the update @eunyongeom. There is a known issue with incremental compilation of Swift since Xcode 14 which can cause random EXC_BAD_ACCESS crashes if a struct or other data type is altered to occupy more memory (eg adding an extra field) than before. The solution is to do a clean build.

eunyongeom commented 1 year ago

@mluisbrown Thank you for your reply. Does this issue only occur in ReactiveSwift? Or is it a problem that other libraries can also occur?

mluisbrown commented 1 year ago

This issue can occur in any project. People using the Composable Architecture also see it a lot.