Skip to content

Crashes when accessing the RLMArray<RLMEmbeddedObject> element #7490

@YJianMu

Description

@YJianMu

How frequently does the bug occur?

All the time

Description

// RLMSupport.swift

public struct RLMCollectionIterator: IteratorProtocol {
private var iteratorBase: NSFastEnumerationIterator

internal init(_ collection: RLMCollection) {
    iteratorBase = NSFastEnumerationIterator(collection)
}

public mutating func next() -> RLMObject? {

// RLMEmbeddedObject forcibly convertsRLMObject crash
return iteratorBase.next() as! RLMObject?
}
}

Stacktrace & log output

Could not cast value of type 'XXXX.XXXXXXX' (0x103296750) to 'RLMObject' (0x7fff8696ab08).

Can you reproduce the bug?

Yes, always

Reproduction Steps

No response

Version

10.17.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

ios

Build environment

Xcode version: ...
Dependency manager and version: ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions