Crashed: com.apple.main-thread
0 Foundation 0x2bd25c specialized static NSDecimal._integerDivide(dividend:divisor:maxResultLength:) + 1996
1 Foundation 0x2c1c0c specialized NSDecimal._divide(by:roundingMode:) + 2432
2 Foundation 0x372710 static NSDecimal./ infix(_:_:) + 64
Crashed: com.um.positions.fiber.queue
0 Foundation 0x2bdc94 <redacted> + 1996
1 Foundation 0x2c2644 <redacted> + 2432
2 Foundation 0x372804 $sSo9NSDecimala10FoundationE1doiyA2B_ABtFZ + 64
After iOS18, some new crashes appeared, but they never appeared before iOS18.
How to avoid such crashes?
I checked the API documentation and there is no relevant modification, https://developer.apple.com/documentation/foundation/1409398-nsdecimaldivide
However, I parsed iOS_22A5326g/../Foundation.framework/Foundation, and found that this EXC_BREAKPOINT is newly added
You can reproduce it with the following code:
let a: Decimal = .greatestFiniteMagnitude
let b: Decimal = .greatestFiniteMagnitude
let c = a / b // if < iOS18, c = 1. if = iOS18, will crashed ;<
print(c)
3
1
1k