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

EXC_BAD_ACCESS on XCode 11.2 and iOS13.2 #150

Closed
mrommel opened this issue Nov 4, 2019 · 3 comments
Closed

EXC_BAD_ACCESS on XCode 11.2 and iOS13.2 #150

mrommel opened this issue Nov 4, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@mrommel
Copy link

mrommel commented Nov 4, 2019

Hi, I have issues since I updated my project to XCode 11.2 and iOS13.2.

EXC_BAD_ACCESS when trying to run "Note" Sample on Simulator or Device.

Can anyone help?

I have uploaded a minimal Sample. Lib is included via SPM. Doesn't matter which version (I tried 0.7.0, 0.8.0 and 0.9.0): https://github.com/mrommel/XMLCoderiOS13_2

@mrommel
Copy link
Author

mrommel commented Nov 4, 2019

Bad Access happens in XMLKeyedDecodingContainer.swift:37

self.decoder = decoder
container.withShared { <===== here
  $0.elements = .init($0.elements.map { (decoder.keyTransform($0), $1) })
  $0.attributes = .init($0.attributes.map { (decoder.keyTransform($0), $1) })
}

Stack trace

Thread 1 Queue : com.apple.main-thread (serial)
#0	0x0000000103b06544 in 0x103b06544 ()
#1	0x0000000103aa56b4 in XMLKeyedDecodingContainer.init(referencing:wrapping:) at /Users/michaelrommel/Library/Developer/Xcode/DerivedData/XMLCoderiOS13_2-basnfrogrwdfddctwofukekijrgn/SourcePackages/checkouts/XMLCoder/Sources/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift:37
#2	0x0000000103a9ad1e in XMLDecoderImplementation.keyedContainer<A>(keyedBy:) at /Users/michaelrommel/Library/Developer/Xcode/DerivedData/XMLCoderiOS13_2-basnfrogrwdfddctwofukekijrgn/SourcePackages/checkouts/XMLCoder/Sources/XMLCoder/Decoder/XMLDecoderImplementation.swift:105
#3	0x0000000103a9a48a in XMLDecoderImplementation.container<A>(keyedBy:) at /Users/michaelrommel/Library/Developer/Xcode/DerivedData/XMLCoderiOS13_2-basnfrogrwdfddctwofukekijrgn/SourcePackages/checkouts/XMLCoder/Sources/XMLCoder/Decoder/XMLDecoderImplementation.swift:77
#4	0x0000000103a9d34b in protocol witness for Decoder.container<A>(keyedBy:) in conformance XMLDecoderImplementation ()
#5	0x00007fff512ebf88 in dispatch thunk of Decoder.container<A>(keyedBy:) ()
#6	0x00000001041a1e02 in Note.init(from:) ()
#7	0x00000001041a2a2a in protocol witness for Decodable.init(from:) in conformance Note ()
#8	0x00007fff512ebf27 in dispatch thunk of Decodable.init(from:) ()
#9	0x0000000103aa36b0 in XMLDecoderImplementation.unbox<A>(_:) at /Users/michaelrommel/Library/Developer/Xcode/DerivedData/XMLCoderiOS13_2-basnfrogrwdfddctwofukekijrgn/SourcePackages/checkouts/XMLCoder/Sources/XMLCoder/Decoder/XMLDecoderImplementation.swift:441
#10	0x0000000103a94e05 in XMLDecoder.decode<A>(_:from:) at /Users/michaelrommel/Library/Developer/Xcode/DerivedData/XMLCoderiOS13_2-basnfrogrwdfddctwofukekijrgn/SourcePackages/checkouts/XMLCoder/Sources/XMLCoder/Decoder/XMLDecoder.swift:369
#11	0x00000001041a2ec1 in XMLCoderiOS13_2Tests.testExample() at /Users/michaelrommel/Prog/XMLCoderiOS13_2/XMLCoderiOS13_2Tests/XMLCoderiOS13_2Tests.swift:43
#12	0x00000001041a383b in @objc XMLCoderiOS13_2Tests.testExample() ()
...

@ydnar
Copy link

ydnar commented Nov 4, 2019

Try disabling dead code stripping on your app’s project: DEAD_CODE_STRIPPING = NO

For additional context, see the underlying bug here: https://bugs.swift.org/browse/SR-11564

@mrommel
Copy link
Author

mrommel commented Nov 5, 2019

Sorry for not thinking this far - thanks a thousand times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants