My app displays a series of pictures. For memory reasons, I want to serialize these pictures when they are not in use. The serialization seems to work (doesn't throw exceptions or crash), but the application crashes on my Picture.createFromStream() call. I can't find anything informative in the LogCat output, nor does the failed call throw a Throwable. Any advice?
12-20 10:48:37.121: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@438abe88
12-20 10:48:37.132: DEBUG/dalvikvm(53): threadid=17: bogus mon 1+0>0; adjusting
12-20 10:48:50.901: DEBUG/dalvikvm(238): GC freed 15257 objects / 1725344 bytes in 99ms
12-20 10:50:26.912: DEBUG/dalvikvm(238): GC freed 29 objects / 1200 bytes in 56ms
12-20 10:51:03.661: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-20 10:51:03.661: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'
12-20 10:51:03.661: INFO/DEBUG(28): pid: 238, tid: 238 >>> com. <<<
12-20 10:51:03.661: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr 00000004
12-20 10:51:03.661: INFO/DEBUG(28): r0 00000004 r1 00000000 r2 00000004 r3 00299b98
12-20 10:51:03.661: INFO/DEBUG(28): r4 00000000 r5 00000000 r6 00000001 r7 00299b00
12-20 10:51:03.661: INFO/DEBUG(28): r8 00299ac0 r9 00000000 10 66616374 fp 00299b60
12-20 10:51:03.661: INFO/DEBUG(28): ip ac1285f4 sp bef065f0 lr ac06fc10 pc afb04408 cpsr 60000010
12-20 10:51:03.771: INFO/DEBUG(28): #00 pc 00004408 /system/lib/libcutils.so
12-20 10:51:03.771: INFO/DEBUG(28): #01 lr ac06fc10 /system/lib/libsgl.so
12-20 10:51:03.771: INFO/DEBUG(28): stack:
12-20 10:51:03.781: INFO/DEBUG(28): bef065b0 00299b00 [heap]
12-20 10:51:03.781: INFO/DEBUG(28): bef065b4 ac07b4f8 /system/lib/libsgl.so
12-20 10:51:03.781: INFO/DEBUG(28): bef065b8 00000000
12-20 10:51:03.781: INFO/DEBUG(28): bef065bc 00616374
12-20 10:51:03.781: INFO/DEBUG(28): bef065c0 00299b78 [heap]
12-20 10:51:03.781: INFO/DEBUG(28): bef065c4 ac038f48 /system/lib/libsgl.so
12-20 10:51:03.781: INFO/DEBUG(28): bef065c8 00299ac0 [heap]
12-20 10:51:03.781: INFO/DEBUG(28): bef065cc 00000001
12-20 10:51:03.781: INFO/DEBUG(28): bef065d0 00299b60 [heap]
12-20 10:51:03.781: INFO/DEBUG(28): bef065d4 00299b78 [heap]
12-20 10:51:03.791: INFO/DEBUG(28): bef065d8 00000000
12-20 10:51:03.791: INFO/DEBUG(28): bef065dc 00000001
12-20 10:51:03.791: INFO/DEBUG(28): bef065e0 00299b00 [heap]
12-20 10:51:03.791: INFO/DEBUG(28): bef065e4 00299b78 [heap]
12-20 10:51:03.791: INFO/DEBUG(28): bef065e8 df002777
12-20 10:51:03.791: INFO/DEBUG(28): bef065ec e3a070ad
12-20 10:51:03.791: INFO/DEBUG(28): #00 bef065f0 00000000
12-20 10:51:03.791: INFO/DEBUG(28): bef065f4 ac06fc10 /system/lib/libsgl.so
12-20 10:51:03.791: INFO/DEBUG(28): bef065f8 bef06647 [stack]
12-20 10:51:03.791: INFO/DEBUG(28): bef065fc 00000001
12-20 10:51:03.801: INFO/DEBUG(28): bef06600 00000070
12-20 10:51:03.801: INFO/DEBUG(28): bef06604 afe0ea00 /system/lib/libc.so
12-20 10:51:03.801: INFO/DEBUG(28): bef06608 00299b00 [heap]
12-20 10:51:03.801: INFO/DEBUG(28): bef0660c afe0ed94 /system/lib/libc.so
12-20 10:51:03.801: INFO/DEBUG(28): bef06610 00299b00 [heap]
12-20 10:51:03.801: INFO/DEBUG(28): bef06614 000001b4
12-20 10:51:03.801: INFO/DEBUG(28): bef06618 000000dc
12-20 10:51:03.801: INFO/DEBUG(28): bef0661c 00002bcc
12-20 10:51:03.801: INFO/DEBUG(28): bef06620 bef06670 [stack]
12-20 10:51:03.811: INFO/DEBUG(28): bef06624 afe0b70f /system/lib/libc.so
12-20 10:51:03.811: INFO/DEBUG(28): bef06628 afe39dd4 /system/lib/libc.so
12-20 10:51:03.811: INFO/DEBUG(28): bef0662c 00299b00 [heap]
12-20 10:51:03.811: INFO/DEBUG(28): bef06630 00299ae0 [heap]
12-20 10:51:03.811: INFO/DEBUG(28): bef06634 00299ac0 [heap]
12-20 10:51:04.661: DEBUG/Zygote(30): Process 238 terminated by signal (11)
12-20 10:51:04.671: INFO/ActivityManager(53): Process com. (pid 238) has died.
12-20 10:51:04.691: INFO/WindowManager(53): WIN DEATH: Window{43899ae8
12-20 10:51:04.701: INFO/WindowManager(开发者_如何学JAVA53): WINDOW DIED during motion dispatch:
12-20 10:51:04.761: WARN/UsageStats(53): Unexpected resume of com.android.launcher while already resumed in
12-20 10:51:04.791: WARN/WindowManager(53): Requested window android.os.BinderProxy@437913d8 does not exist
12-20 10:51:04.791: WARN/WindowManager(53): java.lang.RuntimeException
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7767)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7759)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService.removeWindow(WindowManagerService.java:1359)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService.dispatchPointer(WindowManagerService.java:4078)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService.access$1200(WindowManagerService.java:127)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService$InputDispatcherThread.process(WindowManagerService.java:5356)
12-20 10:51:04.791: WARN/WindowManager(53): at com.android.server.WindowManagerService$InputDispatcherThread.run(WindowManagerService.java:5264)
12-20 10:51:04.832: WARN/InputManagerService(53): Got RemoteException sending setActive(false) notification to pid 238 uid 10023
That is a crash in native code, and therefore qualifies as a platform bug. Very similar stacktraces appear in bug reports 7468 and 2535.
Am afraid you will have to find a workaround fairly blindly. For starters, how many times do you draw to the Canvas between beginRecording() and endRecording()? How big is a typical serialized file?
精彩评论