drawBitmap cause a JVM crash on HTC Desire and Legend

All your problems with Audio, Video and Images.

drawBitmap cause a JVM crash on HTC Desire and Legend

Postby pgalley22 » Sat May 01, 2010 8:51 am

Hi

The following code goes well on Nexus One and on Motorola Milestone but cause a JVM crash on some other devices like HTC Desire or HTC Legend (c is a Canvas):

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. c.drawBitmap(bitmap, new Rect( leftSource /* left */, 0 /*top*/, rightSource /*right*/, bitmap.getHeight() /*bottom*/),
  3.  
  4.                     new Rect( 0 /* left */, 0 /*top*/, mWidth-1 /*right*/, mHeight-1 /*bottom*/),
  5.  
  6.                     null);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


The parameters:

bitmap 720 x 600

leftSource=80
rightSource=559
mWidth=480
mHeight=800


Did you already got such issue? How did you solve it?
Thanks.


The kind of stacktrace:

04-29 17:45:26.371: DEBUG/StormWallpaper(13289): drawImage - before drawBitmap
04-29 17:45:26.521: INFO/DEBUG(54): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-29 17:45:26.521: INFO/DEBUG(54): Build fingerprint: 'htc_wwe/htc_bravo/bravo/bravo:2.1-update1/ERE27/155070:user/release-keys'
04-29 17:45:26.521: INFO/DEBUG(54): pid: 13289, tid: 13289 >>> name.galley.android.wallpapers.storm <<<
04-29 17:45:26.521: INFO/DEBUG(54): signal 11 (SIGSEGV), fault addr 44ceb002
04-29 17:45:26.521: INFO/DEBUG(54): r0 48350880 r1 bea4b028 r2 000000fe r3 48350700
04-29 17:45:26.521: INFO/DEBUG(54): r4 0000000e r5 00000184 r6 00000180 r7 bea4aea4
04-29 17:45:26.521: INFO/DEBUG(54): r8 00000186 r9 00000182 10 0000003f fp 00000164
04-29 17:45:26.521: INFO/DEBUG(54): ip 44ceae80 sp bea4ae74 lr ac04c864 pc ac04f878 cpsr 28000010
04-29 17:45:26.611: INFO/DEBUG(54): #00 pc 0004f878 /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): #01 pc 0004c860 /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): #02 pc 0006143c /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): #03 pc 000861d8 /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): #04 pc 00086354 /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): #05 pc 000863f4 /system/lib/libskia.so
04-29 17:45:26.621: INFO/DEBUG(54): code around pc:
04-29 17:45:26.631: INFO/DEBUG(54): ac04f868 e1a09089 e1a06086 e1a05085 e1a08088
04-29 17:45:26.631: INFO/DEBUG(54): ac04f878 e19c90b9 e19c50b5 e19c80b8 e19c60b6
04-29 17:45:26.631: INFO/DEBUG(54): ac04f888 e1c090b2 e1c050b4 e1c060b0 e1c080b6
04-29 17:45:26.631: INFO/DEBUG(54): code around lr:
04-29 17:45:26.631: INFO/DEBUG(54): ac04c854 e1a0100a e1a02004 e59dc008 e12fff3c
04-29 17:45:26.631: INFO/DEBUG(54): ac04c864 e0555004 e0877084 1affffeb eaffffdf
04-29 17:45:26.631: INFO/DEBUG(54): ac04c874 e92d4ff0 e5904060 e24ddf85 e1a0c000
04-29 17:45:26.631: INFO/DEBUG(54): stack:
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae34 d855ec2a
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae38 6257b1ab
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae3c 8a5dc5ae
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae40 2a7615bb
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae44 abd855ec
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae48 ae6257b1
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae4c bb8a5dc5
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae50 ec2a7615
04-29 17:45:26.631: INFO/DEBUG(54): bea4ae54 b1abd855
04-29 17:45:26.641: INFO/DEBUG(54): bea4ae58 c5ae6257
04-29 17:45:26.641: INFO/DEBUG(54): bea4ae5c 15bb8a5d
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae60 55ec2a76
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae64 57b1abd8
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae68 df002777
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae6c e3a070ad
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae70 3f000000
04-29 17:45:26.651: INFO/DEBUG(54): #00 bea4ae74 000000fe
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae78 000001df
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae7c 000000fe
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae80 48350700 /dev/pmem
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae84 bea4b3f0 [stack]
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae88 000000fe
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae8c bea4aea0 [stack]
04-29 17:45:26.651: INFO/DEBUG(54): #01 bea4ae90 00000164
04-29 17:45:26.651: INFO/DEBUG(54): bea4ae94 c5ae6257
04-29 17:45:26.661: INFO/DEBUG(54): bea4ae98 ac04f80c /system/lib/libskia.so
04-29 17:45:26.661: INFO/DEBUG(54): bea4ae9c ac05317c /system/lib/libskia.so
04-29 17:45:26.661: INFO/DEBUG(54): bea4aea0 0000010b
04-29 17:45:26.661: INFO/DEBUG(54): bea4aea4 00010000 [heap]
04-29 17:45:26.661: INFO/DEBUG(54): bea4aea8 00030002 [heap]
04-29 17:45:26.661: INFO/DEBUG(54): bea4aeac 00050004 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aeb0 00070006 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aeb4 00090008 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aeb8 000b000a [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aebc 000d000c [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aec0 000f000e [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aec4 00110010 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aec8 00130012 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aecc 00150014 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aed0 00170016 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aed4 00190018 [heap]
04-29 17:45:26.671: INFO/DEBUG(54): bea4aed8 001b001a [heap]
--
Romandroid.ch
Le site de référence pour l'activité Android en Suisse romande
pgalley22
Freshman
Freshman
 
Posts: 8
Joined: Thu Dec 10, 2009 5:00 am
Location: Switzerland

Top

HTC Desire & SIGSEV 11

Postby coolbatterygames » Sun May 16, 2010 7:55 pm

I just encountered a simliar error. I assume it's related to HTC desire/bravo. I do not have this error on emulator or different devices (i.e. G1) - but I don't now yet.

Is there any way to catch or analyze this kind of error?

(I already added a uncaught exception handler to any of my threads...)

any help would be appreciated.



I/DEBUG (19802): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG (19802): Build fingerprint: 'htc_wwe/htc_bravo/bravo/bravo:2.1-update1/ERE27/155070:user/release-keys'
I/DEBUG (19802): pid: 25712, tid: 25776 >>> com.mygame.... <<<
I/DEBUG (19802): signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG (19802): r0 4c783848 r1 00000001 r2 4ba7a850 r3 00000000
I/DEBUG (19802): r4 00000027 r5 afe3d9c8 r6 4c783850 r7 0000a000
I/DEBUG (19802): r8 00000000 r9 4ba7ab28 10 4ba7ab00 fp 00000190
I/DEBUG (19802): ip 00000003 sp 4ba7a7e8 lr deadbaad pc afe0b3aa cpsr 20000030
I/DEBUG (19802): #00 pc 0000b3aa /system/lib/libc.so
I/DEBUG (19802): #01 pc 000008e6 /system/lib/libstdc++.so
I/DEBUG (19802): #02 pc 0004c678 /system/lib/libskia.so
I/DEBUG (19802): #03 pc 0006ac10 /system/lib/libskia.so
I/DEBUG (19802): #04 pc 0006d438 /system/lib/libskia.so
I/DEBUG (19802):
I/DEBUG (19802): code around pc:
I/DEBUG (19802): afe0b398 c00cf8c0 23006083 e0066183 e02cf8df
I/DEBUG (19802): afe0b3a8 f88e2427 f0054000 4907fb25 f8d41864
I/DEBUG (19802): afe0b3b8 f01001b4 d0030f02 70dcf504 ee5cf003
I/DEBUG (19802):
I/DEBUG (19802): code around lr:
I/DEBUG (19802): deadba9c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (19802): deadbaac ffffffff ffffffff ffffffff ffffffff
I/DEBUG (19802): deadbabc ffffffff ffffffff ffffffff ffffffff
I/DEBUG (19802):
I/DEBUG (19802): stack:
I/DEBUG (19802): 4ba7a7a8 4ba7a888
I/DEBUG (19802): 4ba7a7ac 00398b98 [heap]
I/DEBUG (19802): 4ba7a7b0 00398b98 [heap]
I/DEBUG (19802): 4ba7a7b4 ac04a9a4 /system/lib/libskia.so
I/DEBUG (19802): 4ba7a7b8 4ba7a888
I/DEBUG (19802): 4ba7a7bc 00398b98 [heap]
I/DEBUG (19802): 4ba7a7c0 afe3db80
I/DEBUG (19802): 4ba7a7c4 afe0f190 /system/lib/libc.so
I/DEBUG (19802): 4ba7a7c8 afe3ae08 /system/lib/libc.so
I/DEBUG (19802): 4ba7a7cc 4c783850
I/DEBUG (19802): 4ba7a7d0 4c783850
I/DEBUG (19802): 4ba7a7d4 4ba7aad8
I/DEBUG (19802): 4ba7a7d8 00000000
I/DEBUG (19802): 4ba7a7dc 4ba7ab28
I/DEBUG (19802): 4ba7a7e0 df002777
I/DEBUG (19802): 4ba7a7e4 e3a070ad
I/DEBUG (19802): #00 4ba7a7e8 4c783888
I/DEBUG (19802): 4ba7a7ec 0039f890 [heap]
I/DEBUG (19802): 4ba7a7f0 00002bc0
I/DEBUG (19802): 4ba7a7f4 4ba7aad8
I/DEBUG (19802): 4ba7a7f8 4c783888
I/DEBUG (19802): 4ba7a7fc 4c783850
I/DEBUG (19802): 4ba7a800 4c783850
I/DEBUG (19802): 4ba7a804 00000000
I/DEBUG (19802): 4ba7a808 4ba7aad8
I/DEBUG (19802): 4ba7a80c afd008e9 /system/lib/libstdc++.so
I/DEBUG (19802): #01 4ba7a810 4c783850
I/DEBUG (19802): 4ba7a814 ac04c67c /system/lib/libskia.so
I/ActivityManager( 75): Process com.mygame.... (pid 25712) has died.
I/WindowManager( 75): WIN DEATH: Window{465a1bf0 SurfaceView paused=false}
D/AudioFlinger( 57): binderDied() 0x58dc0, tid 6401, calling tid 57
D/AudioFlinger( 57): Removing notification client 0x58dc0
coolbatterygames
Freshman
Freshman
 
Posts: 2
Joined: Sun May 16, 2010 7:46 pm

Workaround

Postby pgalley22 » Mon May 17, 2010 4:37 am

After having changed a bit my code, the problem disappeared but I’m not sure why.
I changed:
    - Initially the source image was scaled at load time, now the scaling occurs during the copy to the target image
    - I fixed the way to calculate source and destination rectangles, I suppose that previous code may lead to read/write out of the bitmap and that the Desire didn’t handle it well.
--
Romandroid.ch
Le site de référence pour l'activité Android en Suisse romande
pgalley22
Freshman
Freshman
 
Posts: 8
Joined: Thu Dec 10, 2009 5:00 am
Location: Switzerland

Re: drawBitmap cause a JVM crash on HTC Desire and Legend

Postby coolbatterygames » Mon May 17, 2010 8:59 pm

It seems to be that two of my threads called the same image for drawing.
If the rectangle is manipulated exactly in the moment of drawing, the application crashed.
I synchronized a small part of code around to avoid this and did not see the error again for some hours...

hopefully this was the solution.

many thanks for the idea where to look at...
coolbatterygames
Freshman
Freshman
 
Posts: 2
Joined: Sun May 16, 2010 7:46 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 11 guests