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 during init with data #1100

Open
dheeraj-singh511 opened this issue Apr 22, 2021 · 1 comment
Open

Crash during init with data #1100

dheeraj-singh511 opened this issue Apr 22, 2021 · 1 comment

Comments

@dheeraj-singh511
Copy link

What did you do?

Calling try JSON(data: unZipped) is causing crash inside Swiftyjson library

Crash backtrace

Thread 0 Crashed:
0 libobjc.A.dylib 0x000000019cc92098 getMethodNoSuper_nolock(objc_class*, objc_selector*) + 120
1 libobjc.A.dylib 0x000000019cc9d380 lookUpImpOrForward + 424
2 libobjc.A.dylib 0x000000019cc8b344 object_getMethodImplementation + 276
3 CoreFoundation 0x000000018892f764 _NSIsNSDictionary + 32
4 Foundation 0x0000000189b16aa4 +[_NSJSONReader validForJSON:depth:allowFragments:] + 68
5 Foundation 0x0000000189c59304 __51+[_NSJSONReader validForJSON:depth:allowFragments:]_block_invoke + 92
6 libswiftCore.dylib 0x000000018c5c3a20 function signature specialization <Arg[0] = Dead> of Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 436
7 libswiftCore.dylib 0x000000018c3bae78 @objc Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 40
8 Foundation 0x0000000189b16b08 +[_NSJSONReader validForJSON:depth:allowFragments:] + 168
9 Foundation 0x0000000189c59388 __51+[_NSJSONReader validForJSON:depth:allowFragments:]_block_invoke.131 + 60
10 CoreFoundation 0x00000001888a71d0 NSARRAY_IS_CALLING_OUT_TO_A_BLOCK + 12
11 CoreFoundation 0x00000001888a7800 __NSArrayEnumerate + 404
12 Foundation 0x0000000189b16b78 +[_NSJSONReader validForJSON:depth:allowFragments:] + 280
13 Foundation 0x0000000189c59304 __51+[_NSJSONReader validForJSON:depth:allowFragments:]_block_invoke + 92
14 libswiftCore.dylib 0x000000018c5c3a20 function signature specialization <Arg[0] = Dead> of Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 436
15 libswiftCore.dylib 0x000000018c3bae78 @objc Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 40
16 Foundation 0x0000000189b16b08 +[_NSJSONReader validForJSON:depth:allowFragments:] + 168
17 Foundation 0x0000000189c59304 __51+[_NSJSONReader validForJSON:depth:allowFragments:]_block_invoke + 92
18 libswiftCore.dylib 0x000000018c5c3a20 function signature specialization <Arg[0] = Dead> of Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 436
19 libswiftCore.dylib 0x000000018c3bae78 @objc Swift._SwiftDeferredNSDictionary.enumerateKeysAndObjects(options: Swift.Int, using: @convention(block) (Swift.Unmanaged<Swift.AnyObject>, Swift.Unmanaged<Swift.AnyObject>, Swift.UnsafeMutablePointer<Swift.UInt8>) -> ()) -> () + 40
20 Foundation 0x0000000189b16b08 +[_NSJSONReader validForJSON:depth:allowFragments:] + 168
21 SwiftyJSON 0x000000010803df40 SwiftyJSON.JSON.rawData(options: __C.NSJSONWritingOptions) throws -> Foundation.Data (SwiftyJSON.swift:556)
22 SwiftyJSON 0x000000010803ea8c SwiftyJSON.JSON.(rawString in 4625CC38AABF536BB76490A35D7233C9)(: (extension in Foundation):Swift.String.Encoding, options: [SwiftyJSON.writingOptionsKeys : Any], maxObjectDepth: Swift.Int) throws -> Swift.String? (:0)
23 SwiftyJSON 0x000000010803e0f0 SwiftyJSON.JSON.rawString(
: (extension in Foundation):Swift.String.Encoding, options: __C.NSJSONWritingOptions) -> Swift.String? (SwiftyJSON.swift:565)
24 SwiftyJSON 0x000000010803f134 SwiftyJSON.JSON.description.getter : Swift.String (SwiftyJSON.swift:665)

What did you expect to happen?

App should not crash

What actually happened instead?

App crashed

Environment

List the software versions you're using: iOS 14.3

  • SwiftyJSON: 5.0.0
  • Xcode Version: * 12.0.1 * (Open Xcode; In menubar: Xcode > About Xcode)
  • Swift Version: 5.0 (Open Xcode Preferences; Components > Toolchains. If none, use Xcode Default.)

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Cocoapods: 1.10.1 (Use pod --version in Terminal)
@Moxacist
Copy link

+1 happen

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