leonbreedt / FavIcon

Swift library to detect icons supported by a website.
Other
126 stars 37 forks source link

"FavIcon was compiled with optimization - stepping may behave oddly; variables may not be available." #6

Closed DanielRakh closed 8 years ago

DanielRakh commented 8 years ago

Getting this weird crash...when I try to grab the icon for this url:

"http://www.npr.org/sections/thesalt/2015/12/03/457124796/death-by-coconut-a-story-of-food-obsession-gone-too-far"

Not sure why but I suspect it has something to do with the "/457124796/" url component...possibly something with the encoding with NSURLSession?

P.S. I've checked to make sure the flags on my compiler for optimization are set to "None".

Any ideas?

leonbreedt commented 8 years ago

Hi Daniel,

Thanks for the report!

Did you integrate using Carthage? By default Carthage builds the Release configuration. The Release configuration for FavIcon will compile it with optimizations, which could explain why you get that message when Xcode drops you into the debugger.

You can rebuild without optimizations by doing a carthage update --configuration Debug.

I did this, and tried your URL, and I think I see the problem.

npr.org returns this for the Content-Type header:

Content-Type: text/html;;charset=UTF-8

This breaks the code in in parseAsHTTPContentTypeHeader(), since doesn't deal well with an empty string component, it expects everything after text/html to be in the form NAME=VALUE;.

I've fixed this, and released 1.0.8, could you give that a try?

When I now try that URL in the playground, I get this image:

screen shot 2015-12-06 at 7 00 46 pm
DanielRakh commented 8 years ago

Hey Leon,

Oh...that makes a lot of sense now. And yes I am using Carthage, and thanks for that tip, first project I'm using Carthage, so I'm still learning the ropes around it. Everything seems fine now. Thanks for the speedy fix and awesome framework!

leonbreedt commented 8 years ago

Closing, fixed by 6c73253.