-
-
Save pburleson/2784669 to your computer and use it in GitHub Desktop.
Thread 0 Crashed: | |
0 libsystem_kernel.dylib 0x3602632c __pthread_kill + 8 | |
1 libsystem_c.dylib 0x323de29f abort + 94 | |
2 ImageIO 0x37eca8bf png_error + 114 | |
3 ImageIO 0x37ec9fe3 png_write_end + 46 | |
4 ImageIO 0x37ec6069 writeOnePng + 2260 | |
5 ImageIO 0x37ec578b _CGImagePluginWritePNG + 82 | |
6 ImageIO 0x37ec56fd CGImageDestinationFinalize + 132 | |
7 UIKit 0x37342fa7 UIImagePNGRepresentation + 274 | |
Note: Image data is not nil. |
We had problems with UIImagePNGRepresentation
related to corrupted images, downloaded from a web server. You could identify the corrupted images, by trying to look at them in Safari.
Did you ever find the root of this problem or a solution for this? I'm having the same crash. The images could be downloaded from a web server. I'm thinking of checking the first 8 bytes to confirm it's a PNG but I'm not sure if a zero-sized image would contain this or not.
I'm having this same problem. Attempts to create "bad" UIImages and serialize them using UIImagePNGRepresentation have proved fruitless. My current attempt to figure out what is causing this call to png_error() is create a text file with all the URLs of every possible image in our app and then create a simple iOS app that downloads every image and then attempts to serialize it. I hope this will point out which images are corrupt then allow us to fix it as well as put in some preventative code that will prevent this crash from happening in the case that someone uploads a corrupted image again.
I'll post back with my progress.
Unfortunately after downloading 7500+ images I experienced no errors.
One interesting note is that the crash reports are only for iOS 5.1+.
Getting that crash on this image: http://s4.evcdn.com/images/original/I0-001/013/527/383-5.png_/hawaii-cocktail-week-pacific-sessions-2013-83.png
Anyone come up with a solution?
It looks like the CG PNG plug-in is either failing to call
png_set_error_fn()
, or using an error handler which returns (instead oflongjmp
ing away or throwing an exception). It is then issuing an invalid sequence of PNG writing calls. Libpng is built withsetjmp
support disabled, so the default error handlerabort
s.Presumably not every call to
UIImagePNGRepresentation()
triggers this crash, so there’s probably something about your usage that’s triggering the invalid sequence (for instance, a zero-sized image might lead to no IDAT chunks being written, which seems to be the only call topng_error()
inpng_write_end()
itself).Tl;dr: the specific crash is an Apple bug, but even if they fixed it it must be triggered by some problem on your end.