Closed Bug 1054011 Opened 5 years ago Closed 5 years ago

Why are there sometimes 2 "Preallocated app" processes?


(Firefox OS Graveyard :: General, defect, P1, blocker)

Gonk (Firefox OS)


(Not tracked)



(Reporter: dhylands, Assigned: ting)



(Whiteboard: [caf priority: p1][CR 703260][systemsfe])

+++ This bug was initially created as a clone of Bug #1047645 +++

From bug 1047645 comment 34:

Every 5s: b2g-info                                          1970-01-09 04:15:39

                           |     megabytes    |
            b2g   238    1  910.5    0 9.8 10.7 12.9 40.6 252.2       0 root     
         (Nuwa)  1147  238    3.8    0 0.0  0.1  0.6  7.8  54.1       0 root     
          Video  2376 1147   16.3   18 0.8  0.9  1.8 14.0  85.5      11 u0_a2376 
 Search Results  3405 1147    6.5   18 4.6  5.1  6.7  7.3  66.2      10 u0_a3405 
         Camera  3711 1147   11.1    7 4.1  4.9  7.1 12.7  77.4       6 u0_a3711 
     Homescreen  5461 1147   21.0    1 0.0  0.2  1.1 16.0  77.2       2 u0_a5461 
(Preallocated a 11634 1147    1.8   18 0.0  0.1  0.8 11.0  61.2       1 u0_a11634
(Preallocated a 11635  238    3.1    1 2.8  3.5  5.6  8.3  67.1       2 u0_a11635

There are two preallocated processes, one which was forked from the main b2g process, and one which was forked from the Nuwa process.

This doesn't seem right.
No longer depends on: 1047645
Depends on: 1047645
I'm not sure what this bug depends on, so I'm making it not block 1047645 until we know more about it.
No longer blocks: CAF-v2.0-CC-metabug
No longer depends on: 1053990
I also don't think that this bug depends on the other bugs (copied over from the clone), so I'm removing those too.
QA Whiteboard: 1047645
No longer depends on: 1047645, 1050751, 1041467
QA Whiteboard: 1047645
See Also: → 1047645
(In reply to Mike Habicher [:mikeh] from comment #3)
> Dupe of bug 1051745?

Not sure. In bug 1051745, both "Preallocated app" processes have Nuwa as the parent, which may be a different problem.
If Nuwa is there, "Preallocated" processes should not be from plugin-container.  Ting, could check it?
Flags: needinfo?(tchou)
Played a while but couldn't reproduce, keep NI and keep trying.
Ran into assersion failure while trying repo, filed bug 1054208.
I can see two preallocated processes, one has parent b2g, one has parent nuwa. But sooner or later the one with parent b2g will become an application.

Dave, is this what you saw?

ContentParent::CreateBrowserOrApp() will new a ContentParent if there's no spare process, which will fork a preallocated process from b2g process. There are chances to run into this case while Nuwa is forking as there's no spare process.
Flags: needinfo?(tchou) → needinfo?(dhylands)
I just saw this in some output from bug 1047645 and thought it was weird. Why are we using both mechanisms? Shouldn't we just be using one or the other?

If its expected under some circumstances, then this should probably just be closed as invalid.

I don't know if either one of the preallocated apps went on to become other processes.

I guess my concern is that somehow we'll wind up someday with apps which behave differently in some way based on who the parent is.
Flags: needinfo?(dhylands)
(In reply to Dave Hylands [:dhylands] from comment #9)
> Why are we using both mechanisms? Shouldn't we just be using one or the
> other?

Actually I don't know :-/ But there's a bug 1033618.

I want to make sure it is not the case that none of the two preallocated processes become application. Will try more runs before making this invalid.
(In reply to Dave Hylands [:dhylands] from comment #9)
> I just saw this in some output from bug 1047645 and thought it was weird.
> Why are we using both mechanisms? Shouldn't we just be using one or the
> other?

Bug 1054233 tries to fix this.  But, for preallocated processes, we do use one or the other.  If it is not, there is a bug.  That is why Ting is looking on this to make sure that we don't fall into a real bug described here.
There is a bug here, which the app forked from b2g process is not started completely sometimes.

I tap application icons fast/randomly to launch multiple apps at the same time. Cards view has two apps "Template" and "IME Tests" which IME one (pid 6542) is not renamed, and the screen stays at app splash screen (backtrace shows epoll_wait() in nsAppShell::ProcessNextNativeEvent()):

ting@sweet:~/w/fx/os/flame-v20/gecko$ adb shell b2g-ps
b2g              0 root      2088  1     227348 60136 ffffffff b6e6567c S /system/b2g/b2g
(Nuwa)           0 root      2093  2088  65344  6444  ffffffff b6e6567c S /system/b2g/b2g
Homescreen       2 u0_a2191  2191  2093  85696  23744 ffffffff b6e6567c S /system/b2g/b2g
Template         2 u0_a6496  6496  2093  73316  22584 ffffffff b6e6567c S /system/b2g/b2g
(Preallocated a  2 u0_a6540  6540  2093  71176  20188 ffffffff b6e6567c S /system/b2g/b2g
(Preallocated a  2 u0_a6542  6542  2088  78684  31228 ffffffff b6e9767c S /system/b2g/plugin-container
Should I file a new bug for comment 12, or use this one?
Assignee: nobody → tchou
I filed bug 1056492 for comment 12 as the repro rate is less than 10%, and it is not usual behavior.

Close this as invalid since two preallocated processes is expected, check comment 8.
Closed: 5 years ago
Resolution: --- → INVALID
See Also: → 867739
You need to log in before you can comment on or make changes to this bug.