Page 1 of 1

Crashing on card visual effect

Posted: Wed May 20, 2015 10:35 pm
by MWCoastMedia
This is my first real project, and as a n00b I forgot to keep testing both environments during development. Every time I think I figure out the cause, that doesn't it crash the app the next time but something else does.

My stack works fine in the IDE and in iOS, but crashes constantly (but not always consistently) on Android. Pretty basic scripts just going from card to card, but locking the screen. I've taken out some database information and eliminated some of the navigation GUI in an effort to rebuild piece by piece looking for the cause.

Any help would be appreciated. The file (pared down) is 1.5MB so I can't attach it here, not sure how to share file.

This is what my logcat says:

Code: Select all

F/libc    ( 1556): Fatal signal 11 (SIGSEGV) at 0x4e59e629 (code=1)
I/DEBUG   (  902): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  902): Build fingerprint: 'generic/sdk/generic:4.0.4/MR1/302030:eng/test-keys'
I/DEBUG   (  902): pid: 1556, tid: 1570  >>> com.mwcm.sbbw_android_test <<<
I/DEBUG   (  902): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 4e59e629
I/DEBUG   (  902):  r0 001d995c  r1 0017fe9c  r2 00000003  r3 4e59e625
I/DEBUG   (  902):  r4 4b5b7de8  r5 001d995c  r6 001e9b78  r7 0000000e
I/DEBUG   (  902):  r8 001d995c  r9 0047f810  10 4bd9928c  fp 00000000
I/DEBUG   (  902):  ip 00000000  sp 4bd99190  lr 4ae5a2a3  pc 4ae59a00  cpsr 20000030
I/DEBUG   (  902):  d0  7149f2ca7149f2ca  d1  429750377149f2ca
I/DEBUG   (  902):  d2  3ff0000000000000  d3  4197d78400000000
I/DEBUG   (  902):  d4  3ff0000000000000  d5  4028000000000000
I/DEBUG   (  902):  d6  7e37e43c8800759c  d7  7149f2ca00000000
I/DEBUG   (  902):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  902):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  902):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  902):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  902):  scr 20000012
I/DEBUG   (  902): 
I/DEBUG   (  902):          #00  pc 00302a00  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902):          #01  lr 4ae5a2a3  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902): 
I/DEBUG   (  902): code around pc:
I/DEBUG   (  902): 4ae599e0 98032204 ec30f579 d02e2d00 99036820  ."..y.0..-.. h..
I/DEBUG   (  902): 4ae599f0 f0002204 1c05fc61 28004680 6843d005  ."..a....F.(..Ch
I/DEBUG   (  902): 4ae59a00 9803809f f92cf79f 2008e7de e9cef5e2  ......,.... ....
I/DEBUG   (  902): 4ae59a10 464b4681 809f6006 f5e22008 4643e9c8  .FKF.`... ....CF
I/DEBUG   (  902): 4ae59a20 60436003 1c054649 fd94f008 606b464b  .`C`IF......KFk`
I/DEBUG   (  902): 
I/DEBUG   (  902): code around lr:
I/DEBUG   (  902): 4ae5a280 0123d017 68da18fb d00c2a00 4542681a  ..#....h.*...hBE
I/DEBUG   (  902): 4ae5a290 685ad1f0 d1ed454a 46506899 f578464a  ..ZhJE...hPFJFx.
I/DEBUG   (  902): 4ae5a2a0 2800ef02 1c20d1e6 4690bc1c 46a24699  ...(.. ....F.F.F
I/DEBUG   (  902): 4ae5a2b0 2401bdf0 e7f64264 1e04b5f8 2000d101  ...$dB......... 
I/DEBUG   (  902): 4ae5a2c0 2a00bdf8 4b0dd017 1c084e0d 78051857  ...*...K.N..W..x
I/DEBUG   (  902): 
I/DEBUG   (  902): memory map around addr 4e59e629:
I/DEBUG   (  902): 4cc89000-4dd2b000 
I/DEBUG   (  902): (no map for address)
I/DEBUG   (  902): b0001000-b0009000 /system/bin/linker
I/DEBUG   (  902): 
I/DEBUG   (  902): stack:
I/DEBUG   (  902):     4bd99150  00000004  
I/DEBUG   (  902):     4bd99154  4ae5a2a3  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902):     4bd99158  00000003  
I/DEBUG   (  902):     4bd9915c  0047f810  [heap]
I/DEBUG   (  902):     4bd99160  4bd9928c  
I/DEBUG   (  902):     4bd99164  001e8a98  [heap]
I/DEBUG   (  902):     4bd99168  0bca446c  
I/DEBUG   (  902):     4bd9916c  01000193  
I/DEBUG   (  902):     4bd99170  00480154  [heap]
I/DEBUG   (  902):     4bd99174  4ae5a2e3  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902):     4bd99178  00000004  
I/DEBUG   (  902):     4bd9917c  4b5b7de8  
I/DEBUG   (  902):     4bd99180  00000001  
I/DEBUG   (  902):     4bd99184  001e9b78  [heap]
I/DEBUG   (  902):     4bd99188  df0027ad  
I/DEBUG   (  902):     4bd9918c  00000000  
I/DEBUG   (  902): #00 4bd99190  0047fa0c  [heap]
I/DEBUG   (  902):     4bd99194  4bd992a4  
I/DEBUG   (  902):     4bd99198  00000001  
I/DEBUG   (  902):     4bd9919c  00480150  [heap]
I/DEBUG   (  902):     4bd991a0  0047fc28  [heap]
I/DEBUG   (  902):     4bd991a4  00000003  
I/DEBUG   (  902):     4bd991a8  0047f810  [heap]
I/DEBUG   (  902):     4bd991ac  00000000  
I/DEBUG   (  902):     4bd991b0  4bd9923c  
I/DEBUG   (  902):     4bd991b4  4bd9928c  
I/DEBUG   (  902):     4bd991b8  00000000  
I/DEBUG   (  902):     4bd991bc  4ae59cbd  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902):     4bd991c0  4bd992a4  
I/DEBUG   (  902):     4bd991c4  4aee5540  /data/data/com.mwcm.sbbw_android_test/lib/librevandroid.so
I/DEBUG   (  902):     4bd991c8  0047e4f8  [heap]
I/DEBUG   (  902):     4bd991cc  0047fa0c  [heap]
I/DEBUG   (  902):     4bd991d0  00480080  [heap]
I/DEBUG   (  902):     4bd991d4  ffffffff  
I/BootReceiver(  979): Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
D/Zygote  (  962): Process 1556 terminated by signal (11)
I/ActivityManager(  979): Process com.mwcm.sbbw_android_test (pid 1556) has died.
W/ActivityManager(  979): Force removing ActivityRecord{417ba3f0 com.mwcm.sbbw_android_test/.mblandroid}: app died, no saved state
W/NetworkManagementSocketTagger(  979): setKernelCountSet(10040, 0) failed with errno -2
I/WindowManager(  979): WIN DEATH: Window{419a7838 com.mwcm.sbbw_android_test/com.mwcm.sbbw_android_test.mblandroid paused=false}
W/NetworkManagementSocketTagger(  979): setKernelCountSet(10013, 1) failed with errno -2
D/dalvikvm(  979): GC_CONCURRENT freed 698K, 17% free 14828K/17799K, paused 4ms+5ms
D/dalvikvm(  979): GC_FOR_ALLOC freed 277K, 16% free 15063K/17799K, paused 48ms
D/dalvikvm(  979): GC_CONCURRENT freed 571K, 16% free 15020K/17799K, paused 4ms+10ms
W/EGL_emulation( 1089): eglSurfaceAttrib not implemented
I/Process (  979): Sending signal. PID: 1089 SIG: 3
I/dalvikvm( 1089): threadid=3: reacting to signal 3
W/InputManagerService(  979): Got RemoteException sending setActive(false) notification to pid 1556 uid 10040
I/dalvikvm( 1089): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 1089): GC_CONCURRENT freed 3125K, 31% free 17490K/25223K, paused 3ms+18ms
D/dalvikvm( 1089): GC_FOR_ALLOC freed 96K, 31% free 17470K/25223K, paused 55ms
D/dalvikvm( 1089): GC_FOR_ALLOC freed 37K, 25% free 19038K/25223K, paused 36ms
D/dalvikvm( 1089): GC_FOR_ALLOC freed 608K, 20% free 20278K/25223K, paused 42ms
D/dalvikvm( 1089): GC_FOR_ALLOC freed 3893K, 28% free 18299K/25223K, paused 38ms

Re: Crashing on card visual effect

Posted: Thu May 21, 2015 1:51 pm
by JacobS
Hi Media,

Which visual effects are you using? Only the reveal and scroll visual effects are supported on Android, according to the documentation.
Make sure you only use those if you're expecting to run the same code on iOS and Android.

Hope that helps,
Jacob

Re: Crashing on card visual effect

Posted: Thu May 21, 2015 3:36 pm
by MWCoastMedia
That wasn't it. I guess I realized that many features were platform specific but wasn't paying attention to visual effect. Was using push, which doesn't have any supported platforms listed so I assumed that meant. Changed it to scroll or reveal and still had a problem.

Pulled out almost all images as well in one last ditch effort to get the stack under the attachment limit here. Still crashed.

Then I moved that stack to my Desktop to test (since I knew anybody that downloaded it wouldn't have the referenced file path). Problem solved, sort of. Only files being copied were fonts. So the stack seems to be working in the most thorough Android testing I've been able to do (still waiting approval from Apple, but the iOS version never had a problem with the fonts), however all my formatting is jacked up because text has been defaulted.

I'm going to call this a win though. Not sure yet which font has caused me a week of troubleshooting, code re-written, and second guessing, but that will be easy enough to narrow down and nudge some things around. Really a confidence builder knowing that my coding wasn't to blame, but rather my shatty font selections. Cheers!

Re: Crashing on card visual effect

Posted: Thu May 21, 2015 6:01 pm
by jacque
Livecode should never crash so I'd report this anyway. Lots of people are apt to assign nonexistent fonts on particular platform.

It is pretty easy to manage font selections for a whole stack. If individual objects don't have any font assigned they will inherent the font set on the next object in the hierarchy. Set the textfont of the stack to a native font based on platform when the stack opens and everything will work as long as nothing else in the path has a font assignment. If you've assigned individual fields or buttons then those will not change.

Even easier, don't assign any font to anything. If no font is specified, the stack will automatically use the system font. I usually try to do that whenever possible because it requires no scripting at all.

Finally, if you do need a specific font for some reason you can include it in the standalone build and load it when the stack starts up.

Re: Crashing on card visual effect

Posted: Thu May 21, 2015 10:55 pm
by MWCoastMedia
I did need specific font to match the companies existing branding, and had in included with the stack. It was this font that caused the app to crash when running on in the Android simulator, LiveCode itself didn't crash. And this same stack didn't crash when deployed to iOS which is what took me so long to figure out it was a specific TTF font.