Dear ALL:
      I'm porting Froyo now but I met a strange issue. When I pressed
the power button for a while, the device should have show a dialog to
let me choose power off or other options. However, the dialog didn't
show up. Instead of the dialog, I got some error msgs liking

W/WindowManager( 1628): OutOfResourcesException creating surface
I/WindowManager( 1628): Out of memory for surface!  Looking for
leaks...
W/WindowManager( 1628): No leaked surfaces; killing applicatons!
W/ActivityManager( 1628): Killing processes Free memory at adjustment
0
W/ActivityManager( 1628): Killing ProcessRecord{43ef8988
1713:com.android.launcher/10026} (adj 0): Free memory
W/WindowManager( 1628): Looks like we have reclaimed some memory,
clearing surface for retry.
W/WindowManager( 1628): Due to memory failure, waiting a bit for next
layout

After checking the log , I suspected that it was caused by
surfaceflinger. Then I put some log into some codes that were relative
to Surfaceflinger. I disvoered some clues as below.

D/Surface ( 1628): Surface.jave call2 pid=1628 name= display=0 w=1 h=1
format=-2 flags=0
E/Android_view_Surface( 1628): **[Martin.Send]***Surface_init pid=1628
name_size=0 w=1 h=1 format=-2 flags=0
E/SurfaceComposerClient( 1628):
**[Martin.Send]***SurfaceComposerClient:createSurface pid=1628
name_size=0 w=1 h=1 format=-2 flags=0
E/SurfaceFlinger( 1628): ***[Martin.Send]***ISurfaceFlingerClient
pid=1628 display=0 name_size=0 w=1 h=1 format=-2 flags=0
E/SurfaceFlinger( 1596): [Martin]BnSurfaceFlingerClient::onTransact
pid=1628 display=0 name_size=0 w=0 h=1 format=1 flags=fffffffe
E/SurfaceFlinger( 1596): *****[Martin]********BClient::createSurface
pid=1628 display=0 name_size=0 w=0 h=1 format=1 flags=fffffffe
E/SurfaceFlinger( 1596):
*****[Martin]********SurfaceFlinger:createSurface1 pid=1628
name_size=0 w=0 h=1 format=1 flags=fffffffe
E/SurfaceFlinger( 1596):
*****[Martin]********SurfaceFlinger:createSurface2 pid=1628
name_size=0 w=0 h=1 format=1 flags=fffffffe
E/SurfaceFlinger( 1596): *****[Martin]********SurfaceFlinger create
layer fail
I/SurfaceComposerClient( 1628): ***[Martin]***SurfaceComposerClient
creatsurface fail

As u can see, Android_view_Surface received the correct paramemters
but when it used ibinder to pass the parameters to surfacflinger,
sufaceflinger got the wrong parameters. Since the name field, every
parameters was shifted by 1 size. Therefore, flags became -2 and while
surfaceflinger was parsing the flags, it couldn't find any condition
mathing -2. Thus, OutOfResourcesException happened. I have compared
the source codes about Surfaceflinger, Parcel, ibinder, kernel biner.
They were all the same as common code. I have no idea what happened.
And this only occured when the name field was empty from
Android_view_Surface. The other cases name field would have something
liking app name.  Does anybody have any idea of that ?? thanks~~

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to