Closed Bug 911891 Opened 11 years ago Closed 9 years ago

App is not removed from cardview and cannot re-launch from cardview/homescreen

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: leo.bugzilla.gaia, Unassigned)

Details

Attachments

(1 file)

587.27 KB, text/plain
alive
: feedback+
Details
Description: App is not removed from cardview and cannot re-launch from cardview/homescreen.

This happened after running automated monkey tests, and we're not sure the repro steps. 

Observation: 
1. The app screenshot is in cardview. However nothing happens when the card is touched. (And the following JavaScript Error is printed.)
2. Nothing happens when the icon is touched from homescreen. (And the following JavaScript Error is printed.)
3. There is no process running for the app when "adb shell b2g-ps" is run.

[JavaScript Error: "TypeError: values is undefined" {file: "app://system.gaiamobile.org/js/window_monitor.js" line: 12}]

The only useful information from log is the error above. 

FYI, it was Calendar app which showed this problem. However this might not be an app-specific issue.
To Alive: 

When can it ever have the values undefined?
Your help is very appreciated!
Flags: needinfo?(alive)
(In reply to Leo from comment #1)
> To Alive: 
> 
> When can it ever have the values undefined?
> Your help is very appreciated!

It's not harmful. Could you give me the log after grep 'AppMonitor'?
Flags: needinfo?(alive)
Attached file repro logs
Here's the log. 

Please search for "[JavaScript Error: "TypeError: values is undefined" {file: "app://system.gaiamobile.org/js/window_monitor.js" line: 12}]"

And also, filtering the lines with "Content JS" or "[SystemApp]" would be useful. Thanks.
Attachment #798722 - Flags: feedback?(alive)
I'm suspecting the app process is crashed or killed on gecko side, but Gaia thinks it's still there.
There's no calendar app opened from the log. What's the real user action?
====
AppMonitor: [1378183083.666][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen>
-> z-index: 0; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183129.017][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow default-background>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183129.037][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow default-background opening>
-> z-index: 4; Scale: 0.6; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183129.3][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow default-background opening active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183129.581][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow opening active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183129.69][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183172.188][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183172.191][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183172.401][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow closing>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183172.662][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183187.166][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183187.967][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen>
-> z-index: 0; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183187.97][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183187.998][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183188.139][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow opening>
-> z-index: 65536; Scale: 0.6; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183188.537][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183190.538][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183190.546][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183190.991][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow closing>
-> z-index: 65536; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183191.069][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183192.89][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183193.557][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen>
-> z-index: 0; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183193.56][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183193.587][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183193.722][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow opening>
-> z-index: 65536; Scale: 0.6; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183194.115][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183195.388][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183195.39][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183195.729][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow closing>
-> z-index: 65536; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183195.989][app://sms.gaiamobile.org]
-> ID: appframe71; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183251.286][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen>
-> z-index: 0; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183382.113][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow default-background>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183382.131][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow default-background opening>
-> z-index: 4; Scale: 0.6; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183382.386][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow default-background opening active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183383.081][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow default-background active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183383.219][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183464.009][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen active>
-> z-index: 3; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183464.012][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow active>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183464.227][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow closing>
-> z-index: 4; Scale: 1; Rotate: 0 deg; CSS Visibility: visible

AppMonitor: [1378183464.484][app://settings.gaiamobile.org]
-> ID: appframe72; Class List: <appWindow>
-> z-index: 1; Scale: 0.6; Rotate: 0 deg; CSS Visibility: hidden

AppMonitor: [1378183465.501][app://homescreen.gaiamobile.org]
-> ID: appframe1; Class List: <appWindow homescreen>
-> z-index: 0; Scale: 1; Rotate: 0 deg; CSS Visibility: visible
(In reply to Alive Kuo [:alive] from comment #5)

Yeah, it's very strange. This happened during monkey test and I don't have the log file at the time of things happened.

As per the description, I see the calendar app screenshot in the cardview but I cannot launch the calendar app by tapping the card or tapping the icon from homescreen.

My wild guess is, the calendar Gecko process is killed and Gaia didn't clean up completely. Therefore because of the following reasons, the calendar app cannot be launched again.

Guess 1. The WindowManager.isRunning(Calendar App) returns true.
Guess 2. runningApps[Calendar App].killed is true.

In this case, Swiping off the card from cardview cannot remove the calendar card because runningApps[Calendar App].killed is true. And Launching the calendar app doesn't do anything because WindowManager.isRunning(Calendar App) is true...  Does this make sense??
Maybe. So could you repro it right now?
FYI, 

These are different issue but just to let you know that we have seen number of timing issues found from monkey test 
such as the following and I'm thinking this also might be a timing issue as well?

1. Launch an app and press power button right after. ==> Things happen when the new app frame is not opened yet.
   Therefore the getCurrentDisplayedApp() is still the previous app. 
   The previous app frame gets "setVisible(false)" by the 'lock' event, 
   then the new app frame thinks it is VISIBLE when its transition completes (screen is already off at this time). 
   This causes the app to receive the mozvisibilitychange event when power button is pressed and Lockscreen is displayed.

2. App is not killed, if home key is pressed during WindowManager.kill is processing.
   The following is called when the displayedApp is currently a certain app (not homescreen). 
   However, if the displayedApp changes to homescreen while setDisplayedApp is being processed... (to be continued)

      [from function kill]
        setDisplayedApp(homescreen, function() {
          // This is not called if current displayed app is homescreen.
          removeFrame(origin);
          if (callback) {
            setTimeout(callback);
          }
        });

    the callback is not called by setDisplayedApp, because the currentApp and newApp are both homescreen.
    
      [from function setDisplayedApp]
      
        // Case 1: the app is already displayed
        if (currentApp && currentApp == newApp) {
          if (newApp == homescreen) {
            // relaunch homescreen
            openWindow(homescreen, callback);
          } else {
            if (requireFullscreen(newApp)) {
              screenElement.classList.add('fullscreen-app');
            }

            // Just run the callback right away if it is not homescreen
            if (callback)
              callback();
          }
        }
(In reply to Alive Kuo [:alive] from comment #7)
> Maybe. So could you repro it right now?

Unfortunately no... We'll have to wait until the monkey reproduces it.. Hmm.. so I'm not sure the priority of this issue..
Thanks for reporting.
I personally never heard #1, and #2 looks like https://bugzilla.mozilla.org/show_bug.cgi?id=896776

We already know there's some problems in current window management system about transitioning,
so I'm working on refactoring whole window manager.
See https://bugzilla.mozilla.org/show_bug.cgi?id=902766

Thanks again.

(In reply to hanj.kim25 from comment #8)
> FYI, 
> 
> These are different issue but just to let you know that we have seen number
> of timing issues found from monkey test 
> such as the following and I'm thinking this also might be a timing issue as
> well?
> 
> 1. Launch an app and press power button right after. ==> Things happen when
> the new app frame is not opened yet.
>    Therefore the getCurrentDisplayedApp() is still the previous app. 
>    The previous app frame gets "setVisible(false)" by the 'lock' event, 
>    then the new app frame thinks it is VISIBLE when its transition completes
> (screen is already off at this time). 
>    This causes the app to receive the mozvisibilitychange event when power
> button is pressed and Lockscreen is displayed.
> 
> 2. App is not killed, if home key is pressed during WindowManager.kill is
> processing.
>    The following is called when the displayedApp is currently a certain app
> (not homescreen). 
>    However, if the displayedApp changes to homescreen while setDisplayedApp
> is being processed... (to be continued)
> 
>       [from function kill]
>         setDisplayedApp(homescreen, function() {
>           // This is not called if current displayed app is homescreen.
>           removeFrame(origin);
>           if (callback) {
>             setTimeout(callback);
>           }
>         });
> 
>     the callback is not called by setDisplayedApp, because the currentApp
> and newApp are both homescreen.
>     
>       [from function setDisplayedApp]
>       
>         // Case 1: the app is already displayed
>         if (currentApp && currentApp == newApp) {
>           if (newApp == homescreen) {
>             // relaunch homescreen
>             openWindow(homescreen, callback);
>           } else {
>             if (requireFullscreen(newApp)) {
>               screenElement.classList.add('fullscreen-app');
>             }
> 
>             // Just run the callback right away if it is not homescreen
>             if (callback)
>               callback();
>           }
>         }
> (In reply to hanj.kim25 from comment #8)
> > 1. Launch an app and press power button right after. ==> Things happen when
> > the new app frame is not opened yet.
> >    Therefore the getCurrentDisplayedApp() is still the previous app. 
> >    The previous app frame gets "setVisible(false)" by the 'lock' event, 
> >    then the new app frame thinks it is VISIBLE when its transition completes
> > (screen is already off at this time). 
> >    This causes the app to receive the mozvisibilitychange event when power
> > button is pressed and Lockscreen is displayed.
> > 

This shouldn't happen...screen off means the whole system app is invisible -> every app is invisible -> the new app should observe visibilitychange once screen is off..
Attachment #798722 - Flags: feedback?(alive) → feedback+
I've not seen anything like this recently, if it wasn't already fixed, bug 941238 should have fixed it
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: