Zygot exits in a loop

1,222 views
Skip to first unread message

Dimka Kuznec

unread,
Aug 29, 2010, 2:56:44 AM8/29/10
to android-porting
Hello,

I am trying to port Android to a custom ARM device I have here. The
boot process starts bootanim, it runs for a bit, then restarts. It
never gets further. In serial console I see this:

[ 1354.390496] init: waitpid returned pid 88, status = 00000009
[ 1354.417704] init: process 'bootanim', pid 88 exited
[ 1354.478037] init: waitpid returned pid 44, status = 00000009
[ 1354.495384] init: process 'zygote', pid 44 exited
[ 1354.510140] init: process 'zygote' killing any children in process
group
[ 1354.530832] request_suspend_state: wakeup (3->0) at 77191568646
(2000-01-05 02:21:31.141741544 UTC)
[ 1354.558050] init: service 'media' is being killed
[ 1354.574626] init: starting 'media'
[ 1354.590025] init: starting 'zygote'
[ 1354.618234] init: waitpid returned pid 45, status = 0000000f
[ 1354.642714] init: Created socket '/dev/socket/zygote' with mode
'666', user '0', group '0'
[ 1354.668280] init: untracked pid 45 exited
[ 1380.371337] init: starting 'bootanim'
[ 1407.551103] init: waitpid returned pid 142, status = 00000009
[ 1407.588977] init: process 'bootanim', pid 142 exited
[ 1407.605930] init: waitpid returned pid 123, status = 00000009
[ 1407.624024] init: process 'zygote', pid 123 exited
[ 1407.639244] init: process 'zygote' killing any children in process
group
[ 1407.660305] request_suspend_state: wakeup (0->0) at 130321196644
(2000-01-05 02:22:24.271368927 UTC)
[ 1407.688349] init: service 'media' is being killed
[ 1407.705206] init: starting 'media'
[ 1407.720714] init: starting 'zygote'
[ 1407.762500] init: Created socket '/dev/socket/zygote' with mode
'666', user '0', group '0'
[ 1407.798410] init: waitpid returned pid 122, status = 0000000f
[ 1407.817412] init: untracked pid 122 exited
[ 1432.945955] init: starting 'bootanim'
[ 1460.235224] init: waitpid returned pid 172, status = 00000009
[ 1460.275483] init: process 'bootanim', pid 172 exited
[ 1460.292262] init: waitpid returned pid 158, status = 00000009
[ 1460.310282] init: process 'zygote', pid 158 exited
[ 1460.325991] init: process 'zygote' killing any children in process
group
[ 1460.347248] request_suspend_state: wakeup (0->0) at 183008296330
(2000-01-05 02:23:16.958469536 UTC)
[ 1460.377591] init: service 'media' is being killed
[ 1460.393819] init: starting 'media'
[ 1460.414271] init: starting 'zygote'
[ 1460.436018] init: waitpid returned pid 157, status = 0000000f
[ 1460.465821] init: Created socket '/dev/socket/zygote' with mode
'666', user '0', group '0'
[ 1460.491307] init: untracked pid 157 exited
[ 1485.619588] init: starting 'bootanim'
[ 1512.406315] init: waitpid returned pid 201, status = 00000009
[ 1512.434224] init: process 'bootanim', pid 201 exited
[ 1512.483122] init: waitpid returned pid 186, status = 00000009
[ 1512.500966] init: process 'zygote', pid 186 exited
[ 1512.516113] init: process 'zygote' killing any children in process
group
[ 1512.537293] request_suspend_state: wakeup (0->0) at 235198490184
(2000-01-05 02:24:09.148662159 UTC)
[ 1512.566563] init: service 'media' is being killed
[ 1512.584271] init: starting 'media'
[ 1512.603467] init: waitpid returned pid 185, status = 0000000f
[ 1512.622079] init: untracked pid 185 exited
[ 1512.638978] init: starting 'zygote'
[ 1512.665461] init: Created socket '/dev/socket/zygote' with mode
'666', user '0', group '0'
[ 1537.830871] init: starting 'bootanim'




The system is PXA272-based, and I am using 2.6.32 kernel and latest
android bits (just checked out a few days back)

does anyone have any pointers for me to help debug this issue?

Brad Davis

unread,
Aug 31, 2010, 4:03:31 PM8/31/10
to android-porting
On Aug 29, 12:56 am, Dimka Kuznec <dmitr...@gmail.com> wrote:
> does anyone have any pointers for me to help debug this issue?

How much RAM do you have?

There are processes that Android will restart (or retry) if they can't
run due to lack of resources (memory). A quick glance at init.rc
implies that "bootanim" may not have the resources to run (after
"media") and so "media" is being killed (but "media" has to run so it
is being restarted (this restart is so if any of the critical
software dies, the phone doesn't need a hard reboot...)

You can comment "bootanim" out of the init.rc and see if you die in
"dbus" or later...

Deva R

unread,
Sep 1, 2010, 3:10:14 AM9/1/10
to bda...@cove-mtn.com, android-porting

>How much RAM do you have?
also, make sure 
 - ext3 file system partition size (like atleast 150 MB) is ok
 - few file entries have r+w permission (probably run 'chmod -R 777 *' for whole filesystem for now)


Ben Dooks

unread,
Sep 1, 2010, 3:38:46 PM9/1/10
to r.de...@gmail.com, bda...@cove-mtn.com, android-porting
On Wed, Sep 1, 2010 at 8:10 AM, Deva R <r.de...@gmail.com> wrote:

>How much RAM do you have?
also, make sure 
 - ext3 file system partition size (like atleast 150 MB) is ok
 - few file entries have r+w permission (probably run 'chmod -R 777 *' for whole filesystem for now)


On Wed, Sep 1, 2010 at 1:33 AM, Brad Davis <bda...@cove-mtn.com> wrote:
On Aug 29, 12:56 am, Dimka Kuznec <dmitr...@gmail.com> wrote:
> does anyone have any pointers for me to help debug this issue?

How much RAM do you have?

There are processes that Android will restart (or retry) if they can't
run due to lack of resources (memory).  A quick glance at init.rc
implies that "bootanim" may not have the resources to run (after
"media") and so "media" is being killed (but "media" has to run so it
is being restarted  (this restart is so if any of the critical
software dies, the phone doesn't need a hard reboot...)

You can comment "bootanim" out of the init.rc and see if you die in
"dbus" or later.

The system will also exit silently if certain kernel subsystems are not
present. Check you have battery support (even if no specific driver) and
all the android drivers are there.

I had real problems due to it not being able to open bits of /sys without it
showing any error.

--
Ben
 

Dmitry Grinberg

unread,
Sep 3, 2010, 1:02:21 PM9/3/10
to android-porting


I have very little RAM, but I have swap enabled (I know it will be slow). Somehow android managed to avoid using swap and just dies. Where can I change this behaviour?  [it boots fine with 64MB of ram, hangs with this problem on 32 or less]



----
Best Regards,


Dianne Hackborn

unread,
Sep 5, 2010, 1:48:08 AM9/5/10
to dmit...@gmail.com, android-porting
I really doubt you can run Android on 32MB or RAM.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Brad Davis

unread,
Sep 5, 2010, 7:34:04 PM9/5/10
to android-porting
I don't think the standard Android kernel has swap enabled and/or
configured (and you don't want to swap to flash as you will quickly
kill the flash).

And yes, I've watched memory usage as Android boots and you need 64mb.

Dianne Hackborn

unread,
Sep 5, 2010, 10:55:51 PM9/5/10
to Dmitry Grinberg, android-porting
Currently Android isn't designed to be used with swap, ans isn't designed to run in 32 MB RAM.

On Sun, Sep 5, 2010 at 6:11 PM, Dmitry Grinberg <dmit...@gmail.com> wrote:
the entore ubuntu desktop starts with 16mb + swap, why wouldn't android?
----
Best Regards

Dmitry Grinberg

unread,
Sep 5, 2010, 9:11:48 PM9/5/10
to bda...@cove-mtn.com, android-porting
My kernel has swap enabled.


----
Best Regards




--

Dmitry Grinberg

unread,
Sep 6, 2010, 1:12:01 AM9/6/10
to Dianne Hackborn, android-porting
My question was about that exactly: are there specific provisions in code to forcefully avoid usage of swap, or is it just that nobody tested it with swap?

----
Best Regards

Dmitry Grinberg

unread,
Sep 5, 2010, 9:11:32 PM9/5/10
to Dianne Hackborn, android-porting
the entore ubuntu desktop starts with 16mb + swap, why wouldn't android?
----
Best Regards


On Sat, Sep 4, 2010 at 10:48 PM, Dianne Hackborn <hac...@android.com> wrote:

Brad Davis

unread,
Sep 6, 2010, 5:38:07 PM9/6/10
to android-porting
You also need to bind swap to disk partitions and/or files (I can't
help you here as I don't do this on Linux kernels with fancy
bootloaders...).

Again, don't do this on flash unless you are ready to replace the
flash often. Swap heavily writes (if you have the memory to cache the
swap, then don't swap) the disk, which is extremely slow on flash and
the flash will break after a relatively small number of writes.

I can't tell you much about the swap subsystem on Linux, but it is
possible that swapping to a flash partition will bypass the code that
handles bad flash blocks.

Swapping to a flash file may double the actual number of writes
(because of the interaction between writing single blocks in the file
and the way flash file systems work), killing the flash faster.

Has Android been tested with swapping? Probably not, it is an
embedded system, not a general purpose OS (I know I wouldn't expend
any resources testing it). It may work, but then again, the Google
additions to the standard kernel may prevent swapping from working
properly (after all, swapping is turned off for kernel development and
testing). Did the kernel engineers plan to disable swapping?,
probably not, but kernels are complex masses of code and things
happen.

I just checked my Ubuntu desktop. It is using 1gig of memory (no swap
because my machine has 3gig) of which about 45meg is the X server and
another 66+meg is Gnome. A full Unbuntu desktop would thrash 16meg to
death... (Firefox alone uses almost 200meg of virtual memory.) (I
have actually used X/Motif on 16meg machines and we didn't get to have
all the eye-candy that people now expect.)

That said, if you have a hard disk installed or you swap over the
network, you need to understand and modify the Android partitions
(which were set up for flash) and possibly the mount code in init.rc.
It probably isn't hard, but I doubt that many people are doing this
(Android is a battery OS and dependencies on networks and disks don't
work well on batteries).

So, if you don't understand swapping and don't understand flash/flash
file systems, you are probably going to have to learn a bunch. You
have probably alone in your endeavors as the rest of the Android
community isn't going to swap (I can tell you what it takes to
support a 5:5:5 screen).

Good Luck.

On Sep 5, 7:11 pm, Dmitry Grinberg <dmitr...@gmail.com> wrote:
> My kernel has swap enabled.
>
> ----
> Best Regards
>
> On Sun, Sep 5, 2010 at 4:34 PM, Brad Davis <bda...@cove-mtn.com> wrote:
> > I don't think the standard Android kernel has swap enabled and/or
> > configured (and you don't want to swap to flash as you will quickly
> > kill the flash).
>
> > And yes, I've watched memory usage as Android boots and you need 64mb.
>
> > --
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-porting

Dmitry Grinberg

unread,
Sep 6, 2010, 10:31:05 PM9/6/10
to bda...@cove-mtn.com, android-porting
I am well familiar with flash and kernel and swapping. I am unfamiliar with android kernel patches and userspace, hence the question.
the device has a hard-disk, so wear is not an issue. I mount swap in android's init in the ramdisk and it indeed is enabled (as seen by runnig top on serial console)

----
Best Regards


Dianne Hackborn

unread,
Sep 6, 2010, 11:25:57 PM9/6/10
to Dmitry Grinberg, android-porting
On Sun, Sep 5, 2010 at 10:12 PM, Dmitry Grinberg <dmit...@gmail.com> wrote:
My question was about that exactly: are there specific provisions in code to forcefully avoid usage of swap, or is it just that nobody tested it with swap?

It was designed with the assumption there would be no swap.  Instead it relies on an out of memory killer to remove background processes when memory is getting low.  Having this behavior work well with swap raises a lot of issues about how the two interact...  to be honest, I would lean towards not using swap even if you can because a swapping system results in a much worse experience (delayed UI response) than one where background processes are killed.

Note that we *do* rely on paging, just not swap.

Brad Davis

unread,
Sep 8, 2010, 2:48:54 AM9/8/10
to android-porting
You can make sure your kernel is really working with a standard Linux
distribution.

I would be a bit harsher than Dianne, the out-of-memory-killer
probably does really bad things under virtual memory, at least causing
the system to thrash and possibly building huge data trees for non-
existent memory (all of which need to be in real memory).

Dalvik may lock memory, the shared memory code may lock memory (this
may happen unintentionally when the code writers were designing for a
constrained, but non swapping, system).

The C based userspace is probably virtual memory friendly.

P.S. Seymour Cray thought that swapping was bad.
> > <android-porting%2Bunsu...@googlegroups.com<android-porting%252Buns...@googlegroups.com>
>
> > > > website:http://groups.google.com/group/android-porting
>
> > --
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-porting
Reply all
Reply to author
Forward
0 new messages