-
Notifications
You must be signed in to change notification settings - Fork 113
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
Bad access error when running on device #100
Comments
Hi @TheFlow95, can you please attach any code and XML snippets that reproduce this for you? Thanks! |
The code I used is the same as func parseEntry<T: Decodable>(_ path: String, _ type: T.Type) throws -> T {
guard let entry = archive[path] else {
throw Error.archiveEntryNotFound
}
var data = Data()
_ = try archive.extract(entry, bufferSize: bufferSize) {
data.append($0)
}
return try decoder.decode(type, from: data)
} And when this method is executed it produces the error on the device. |
@TheFlow95 would you be able to attach the file and the project that reproduce this for you? I'm inclined to think this has something to do with project settings or the file. I'm not able to reproduce it with the CoreXLSX Example project and Xcode 10.2 on 2017 iPad Pro 10.5-inch and iPhone X both running iOS 12.2. |
I cannot attach my project but I am working on a framework that includes
let path = Bundle.main.resourceURL!.appendingPathComponent("sample.pptx").path
if let swiftPresentationML = SwiftPresentationML(filepath: path) {
do {
guard let entry = swiftPresentationML.archive["ppt/presentation.xml"] else {
fatalError()
}
var data = Data()
_ = try swiftPresentationML.archive.extract(entry) {
data.append($0)
}
print(try XMLDecoder().decode(PresentationXML.self, from: data))
}
catch {
print(error)
}
}
else {
fatalError()
} I can reproduce with any PowerPoint file but I'm attaching one here Thanks for you help! |
Thank you for the file. It's really great to see the interest in .pptx format support. I'm probably going to rename |
Hey @TheFlow95, I've just pushed .pptx support to the Example project of That project builds and runs without a problem on both of my devices I listed in previous comments, it displays structures of .xlsx and your sample.pptx file in different tabs. Interesting to hear if this example project has any substantial difference from your project? I look forward to hearing from you. |
Hello @MaxDesiatov! I tried your example project on my device and it does work. I am starting to think this is some kind of stack overflow problem, because I load in memory the file with structs. Do you know things about it? |
Hi @TheFlow95, thanks for the update. I don't know of any possible stack overflow problems in CoreXLSX or XMLCoder. I hope the full stack trace of the crash (if sharing your isolated project is not possible) could point in the right direction. Would you mind sharing that stack trace here? Or you could share the project to xmlcoder@desiatov.com |
As a workaround, I changed my structs into classes but I don't know if it's a good thing to do (memory seems okay)… |
Hi @TheFlow95, is this still reproducible for you? Can this issue be closed otherwise? |
As this issue hasn't been updated for quite a while, I'm closing it as outdated. Please feel free to reopen if needed. |
After working on simulator on my app, I wanted to test it on my iPad but I have a EXC_BAD_ACCESS on line 382 of XMLDecoderImplementation.swift. This error isn't present when I run the app on the simulator.
I run the app on a 2017 iPad with iOS 12.1.4 and for the simulator I used the iPad Pro 11" with iOS 12.2.
The text was updated successfully, but these errors were encountered: