[android-developers] Re: 1.5 quits for apparently no reason whilst animating (WIN DEATH)

2010-11-23 Thread Jason
Can you post some code?  Specifically the portion that does the
drawing.

On Nov 23, 1:44 am, Muleskinner  wrote:
> Hi,
>
> I have an app that is working fine in 1.6 and up but crashing for
> apparently no reason in 1.5. The app suddenly quits with the following
> message...
>
> I/WindowManager(  563): WIN DEATH: Window{43717218
> com.bitbull.meat.android/com.bitbull.meat.android.MEATActivity
> paused=false}
> I/WindowManager(  563): WIN DEATH: Window{4373f458 SurfaceView
> paused=false}
> D/Zygote  (  541): Process 723 terminated by signal (11)
> W/InputManagerService(  563): Got RemoteException sending
> setActive(false) notification to pid 723 uid 10019
>
> This error happens when the app is 'idling' (ie not doing anything
> other than redrawing the screen). There is no state change and no user
> input. The error occurs after the same amount of elapsed time whatever
> I set the frame rate of the app to and occurs both on the emulator and
> device. Changing what I display on screen can stop the error but there
> appears to be no logic to this (in one instance not drawing a large
> image stops the error but elsewhere just drawing some text causes the
> app to crash in the same manner).
>
> I am using SurfaceView for animations following the basic procedure in
> the Lunar Lander sample app.
>
> If anyone could help with this I would be *extremely* grateful as it
> has me completely stumped at the moment.
>
> best regards

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 1.5 quits for apparently no reason whilst animating (WIN DEATH)

2010-11-23 Thread Muleskinner
Hi Jason,

Thanks for the reply. It's quite difficult to post code as there's a
whole bunch of APIs I've ported over from JavaME that make up what's
going on. I am going to try and whittle everything down to a simple
test case.

The basic 'draw' loop is the same as in the 'Lunar Lander' source,
repeat the following within a 'run' loop...

private final void drawToScreen(Rect rect)
{
android.graphics.Canvas c = null;
try
{
//
// get a surface to draw on and notify that drawing is about to
begin
//
c = getHolder().lockCanvas(null);
synchronized (getHolder())
{
// do the drawing
onDraw(c);
}
}
finally
{
// do this in a finally so that if an exception is thrown
// during the above, we don't leave the Surface in an
// inconsistent state
if (c != null)
{
// ok - we've finishsed drawing
getHolder().unlockCanvasAndPost(c);
}
}
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 1.5 quits for apparently no reason whilst animating (WIN DEATH)

2010-11-24 Thread Muleskinner
Hi,

After some more experimentation it appears that this is nothing to do
with the drawing per se. The app still crashes even if I just load a
fullscreen image at a certain point (though it doesn't actually crash
at the moment the image is loaded but about a second after) even if I
remove all drawing code and pretty much all run loop code!

This would seem to indicate a heap issue - could Android be shutting
down the app because it perceives it to be using too much memory? I
have tried setting vm.heapSize for the avd to 64megs and this makes no
difference. Also a test app I ran loads ten fullscreen images with no
problems (and the app that's crashing loads considerably less than
this).

Does this sort of issue ring any bells with anyone? Are there any
known limits on java code size, offscreen image size, class code size,
size for static variables or anything like this that could be causing
me problems?

Still completely stumped and any help appreciated. Stack trace from
the crash below if this means anything to anyone...

I/DEBUG   (  539): signal 11 (SIGSEGV), fault addr 0004
I/DEBUG   (  539):  r0 0004  r1 4001d040  r2 0004  r3 ad3296c5
I/DEBUG   (  539):  r4   r5   r6 ad33cce1  r7 41039fb8
I/DEBUG   (  539):  r8 100ffd00  r9 41039fb0  10 41039fa0  fp 0001
I/DEBUG   (  539):  ip ad35b874  sp 100ffce8  lr ad3296cf  pc
afb045a8  cpsr 0010
I/DEBUG   (  539):  #00  pc 45a8  /system/lib/libcutils.so
I/DEBUG   (  539):  #01  lr ad3296cf  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): stack:
I/DEBUG   (  539): 100ffca8  
I/DEBUG   (  539): 100ffcac  
I/DEBUG   (  539): 100ffcb0  
I/DEBUG   (  539): 100ffcb4  
I/DEBUG   (  539): 100ffcb8  
I/DEBUG   (  539): 100ffcbc  41f84728
I/DEBUG   (  539): 100ffcc0  0001
I/DEBUG   (  539): 100ffcc4  41f84728
I/DEBUG   (  539): 100ffcc8  0001
I/DEBUG   (  539): 100ffccc  
I/DEBUG   (  539): 100ffcd0  
I/DEBUG   (  539): 100ffcd4  410903b0
I/DEBUG   (  539): 100ffcd8  100ffd30
I/DEBUG   (  539): 100ffcdc  0005
I/DEBUG   (  539): 100ffce0  df002777
I/DEBUG   (  539): 100ffce4  e3a070ad
I/DEBUG   (  539): #00 100ffce8  
I/DEBUG   (  539): 100ffcec  ad3296cf  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffcf0  100ffd20
I/DEBUG   (  539): 100ffcf4  ad33ccf1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffcf8  4001d040
I/DEBUG   (  539): 100ffcfc  ad00e3b8  /system/lib/libdvm.so
I/DEBUG   (  539): 100ffd00  410903b0
I/DEBUG   (  539): 100ffd04  001015a8  [heap]
I/DEBUG   (  539): 100ffd08  ad33cce1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffd0c  4001d040
I/DEBUG   (  539): 100ffd10  1071
I/DEBUG   (  539): 100ffd14  001015a8  [heap]
I/DEBUG   (  539): 100ffd18  100ffd20
I/DEBUG   (  539): 100ffd1c  ad040a8d  /system/lib/libdvm.so
I/DEBUG   (  539): 100ffd20  41039fb0
I/DEBUG   (  539): 100ffd24  42f8
I/DEBUG   (  539): 100ffd28  ad33cce1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffd2c  100ffd98

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: 1.5 quits for apparently no reason whilst animating (WIN DEATH)

2010-11-25 Thread Muleskinner
SOLVED!

The issue appears to have been caused by keeping pointers for drawing
on offscreen images.

I have a six or seven small offscreen images in memory that are
updated periodically. I was maintaining a Canvas pointer for each of
them, e.g.:

Bitmap bitmap = Bitmap.createBitmap( 128, 32,
Bitmap.Config.ARGB_ );
Canvas canvas = new Canvas( bitmap );

If I stopped holding these canvas objects in memory and instead
instantiate a new one each time I need to draw on the offscreen image
it works fine.

I wasn't drawing on the images or anything when the crash occurred,
but for some reason keeping multiple offscreen Canvas objects in
memory seems to cause 1.5 to barf.

Very hard to debug as basically I'm working with an entire finished
game that has been ported from JavaME using a JavaME->Android
'wrapper' that I've written.

Thanks for the input everyone.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: 1.5 quits for apparently no reason whilst animating (WIN DEATH)

2010-11-24 Thread Kostya Vasilyev

SIGSEGV is a memory access violation.

Some piece of code somewhere has a stray pointer, and accesses memory 
pages that it doesn't own.


And from the information you posted, it looks like it's Dalvik 
(libdvm.so) that makes a call to C language utilities (libcutils.so).


How complex is your application at this point?

Can you remove code piece by piece to see what might make a difference? 
Or perhaps take the opposite track - start over again with HelloWorld, 
build it up, until you see the crash again?


-- Kostya

24.11.2010 18:07, Muleskinner пишет:

Hi,

After some more experimentation it appears that this is nothing to do
with the drawing per se. The app still crashes even if I just load a
fullscreen image at a certain point (though it doesn't actually crash
at the moment the image is loaded but about a second after) even if I
remove all drawing code and pretty much all run loop code!

This would seem to indicate a heap issue - could Android be shutting
down the app because it perceives it to be using too much memory? I
have tried setting vm.heapSize for the avd to 64megs and this makes no
difference. Also a test app I ran loads ten fullscreen images with no
problems (and the app that's crashing loads considerably less than
this).

Does this sort of issue ring any bells with anyone? Are there any
known limits on java code size, offscreen image size, class code size,
size for static variables or anything like this that could be causing
me problems?

Still completely stumped and any help appreciated. Stack trace from
the crash below if this means anything to anyone...

I/DEBUG   (  539): signal 11 (SIGSEGV), fault addr 0004
I/DEBUG   (  539):  r0 0004  r1 4001d040  r2 0004  r3 ad3296c5
I/DEBUG   (  539):  r4   r5   r6 ad33cce1  r7 41039fb8
I/DEBUG   (  539):  r8 100ffd00  r9 41039fb0  10 41039fa0  fp 0001
I/DEBUG   (  539):  ip ad35b874  sp 100ffce8  lr ad3296cf  pc
afb045a8  cpsr 0010
I/DEBUG   (  539):  #00  pc 45a8  /system/lib/libcutils.so
I/DEBUG   (  539):  #01  lr ad3296cf  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): stack:
I/DEBUG   (  539): 100ffca8  
I/DEBUG   (  539): 100ffcac  
I/DEBUG   (  539): 100ffcb0  
I/DEBUG   (  539): 100ffcb4  
I/DEBUG   (  539): 100ffcb8  
I/DEBUG   (  539): 100ffcbc  41f84728
I/DEBUG   (  539): 100ffcc0  0001
I/DEBUG   (  539): 100ffcc4  41f84728
I/DEBUG   (  539): 100ffcc8  0001
I/DEBUG   (  539): 100ffccc  
I/DEBUG   (  539): 100ffcd0  
I/DEBUG   (  539): 100ffcd4  410903b0
I/DEBUG   (  539): 100ffcd8  100ffd30
I/DEBUG   (  539): 100ffcdc  0005
I/DEBUG   (  539): 100ffce0  df002777
I/DEBUG   (  539): 100ffce4  e3a070ad
I/DEBUG   (  539): #00 100ffce8  
I/DEBUG   (  539): 100ffcec  ad3296cf  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffcf0  100ffd20
I/DEBUG   (  539): 100ffcf4  ad33ccf1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffcf8  4001d040
I/DEBUG   (  539): 100ffcfc  ad00e3b8  /system/lib/libdvm.so
I/DEBUG   (  539): 100ffd00  410903b0
I/DEBUG   (  539): 100ffd04  001015a8  [heap]
I/DEBUG   (  539): 100ffd08  ad33cce1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffd0c  4001d040
I/DEBUG   (  539): 100ffd10  1071
I/DEBUG   (  539): 100ffd14  001015a8  [heap]
I/DEBUG   (  539): 100ffd18  100ffd20
I/DEBUG   (  539): 100ffd1c  ad040a8d  /system/lib/libdvm.so
I/DEBUG   (  539): 100ffd20  41039fb0
I/DEBUG   (  539): 100ffd24  42f8
I/DEBUG   (  539): 100ffd28  ad33cce1  /system/lib/
libandroid_runtime.so
I/DEBUG   (  539): 100ffd2c  100ffd98




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en