Release build of app linked with zbarlib crashes unless debug symbols included

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Release build of app linked with zbarlib crashes unless debug symbols included

technohead
Hi guys,
   I have an app that uses the zbarlib barcode scanner library (native library). It works fine with the debug build to the physical device, but crashes when I build it as release unless I include the debug symbols. Any ideas what's going on there?

thanks,
Dennis
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Release build of app linked with zbarlib crashes unless debug symbols included

technohead
Found the line of code that was causing the crash, and a workaround.

// this crashes the app when compiled in release mode
// unless it is compiled with debugging symbols
//string s = ZBarSDK.BarcodeResultsKey;
string s = "ZBarReaderControllerResults";

var results = info[s];

For some reason, trying to retrieve the string constant (I assume) from the library would cause a crash if compiled as release and without debugging symbols. Compiling with debugging symbols seemed to fix the problem.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Release build of app linked with zbarlib crashes unless debug symbols included

Rolf Bjarne Kvinge
Hi,

Most likely this is because in release mode we strip out symbols by default, so when your app tries to load the string constant zbarlib will dynamically look up the constant by name (which will fail because the symbols were stripped out).

You can fix this by adding "-nosymbolstrip:symbol1,symbol2" to the additional mtouch arguments in the project's iOS Build configuration (remember to do it for the release configuration).

Best regards,
Rolf

On Wed, Jul 10, 2013 at 8:13 AM, technohead <[hidden email]> wrote:
Found the line of code that was causing the crash, and a workaround.

// this crashes the app when compiled in release mode
// unless it is compiled with debugging symbols
//string s = ZBarSDK.BarcodeResultsKey;
string s = "ZBarReaderControllerResults";

var results = info[s];

For some reason, trying to retrieve the string constant (I assume) from the
library would cause a crash if compiled as release and without debugging
symbols. Compiling with debugging symbols seemed to fix the problem.




--
View this message in context: http://monotouch.2284126.n4.nabble.com/Release-build-of-app-linked-with-zbarlib-crashes-unless-debug-symbols-included-tp4658371p4658372.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Release build of app linked with zbarlib crashes unless debug symbols included

technohead
Ah ok, that makes sense. Thanks Rolf!
Loading...