Closed Bug 735283 Opened 12 years ago Closed 10 years ago

ERROR/StrictMode: class org.mozilla.gecko.RemoteTabs; instances=2; limit=1 when clicking synced tabs link

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(blocking-fennec1.0 -)

RESOLVED WORKSFORME
Tracking Status
blocking-fennec1.0 --- -

People

(Reporter: tchung, Unassigned)

References

Details

(Whiteboard: [sync])

Attachments

(1 file)

I'm seeing this strictmode message when opening the "Synced tabs" link in tab browsing menu.
03-13 09:23:36.994: DEBUG/NetworkConnectivityReceiver(31545): Network connectivity changed, status is: true
03-13 09:23:37.033: DEBUG/dalvikvm(31545): GC_FOR_ALLOC freed 733K, 10% free 16445K/18247K, paused 28ms
03-13 09:23:37.041: INFO/dalvikvm-heap(31545): Grow heap (frag case) to 17.129MB for 1048592-byte allocation
03-13 09:23:37.080: DEBUG/dalvikvm(31545): GC_FOR_ALLOC freed 2K, 10% free 17467K/19335K, paused 22ms
03-13 09:23:37.174: WARN/InputManagerService(206): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41a91e80 (uid=10061 pid=2295)
03-13 09:23:37.205: DEBUG/dalvikvm(31545): GC_CONCURRENT freed 28K, 10% free 17480K/19335K, paused 2ms+5ms
03-13 09:23:37.205: VERBOSE/ChromeBrowserSyncAdapter(31545): Received sync tickle for all types in ChromeBrowserSyncAdapter
03-13 09:23:37.244: WARN/TextLayoutCache(31545): computeValuesWithHarfbuzz -- need to force to single run
03-13 09:23:37.557: DEBUG/AndroidChannel(31545): Delivering outbound message:151 bytes
03-13 09:23:37.572: INFO/ActivityManager(206): Displayed com.android.chrome/.Main: +1s909ms
03-13 09:23:37.861: INFO/chromium(31545): [INFO:CONSOLE(6)] "Viewport argument value "device-width;" for key "width" not recognized. Content ignored.", source: http://mashable.com/ (6)
03-13 09:23:37.861: INFO/chromium(31545): [INFO:CONSOLE(6)] "Viewport argument value "1.0;" for key "initial-scale" was truncated to its numeric prefix.", source: http://mashable.com/ (6)
03-13 09:23:37.861: INFO/chromium(31545): [INFO:CONSOLE(6)] "Viewport argument value "yes;" for key "user-scalable" not recognized. Content ignored.", source: http://mashable.com/ (6)
03-13 09:23:38.432: DEBUG/dalvikvm(2295): GC_EXPLICIT freed 689K, 47% free 18099K/34119K, paused 59ms+6ms
03-13 09:23:38.439: ERROR/StrictMode(2295): class org.mozilla.gecko.AwesomeBar; instances=2; limit=1
03-13 09:23:38.439: ERROR/StrictMode(2295): android.os.StrictMode$InstanceCountViolation: class org.mozilla.gecko.AwesomeBar; instances=2; limit=1
03-13 09:23:38.439: ERROR/StrictMode(2295):     at android.os.StrictMode.setClassInstanceLimit(StrictMode.java:1)
03-13 09:23:39.119: WARN/SurfaceTexture(31545): freeAllBuffersExceptCurrentLocked called but mQueue is not empty
03-13 09:23:39.150: INFO/WindowManager(206): createSurface Window{41dfb150 InputMethod paused=false}: DRAW NOW PENDING
03-13 09:23:40.088: INFO/WindowManager(206): createSurface Window{41cc9aa8 PopupWindow:419d5940 paused=false}: DRAW NOW PENDING
03-13 09:23:40.135: INFO/WindowManager(206): createSurface Window{41cedc98 PopupWindow:419d5f88 paused=false}: DRAW NOW PENDING
03-13 09:23:44.135: INFO/WindowManager(206): createSurface Window{41e9d1c0 PopupWindow:419d5f88 paused=false}: DRAW NOW PENDING
03-13 09:23:44.244: INFO/WindowManager(206): createSurface Window{42059cc0 PopupWindow:419d5940 paused=false}: DRAW NOW PENDING
03-13 09:23:45.283: DEBUG/SandboxedProcessLauncher(31545): Setting up connection to process: slot=1
03-13 09:23:45.314: DEBUG/dalvikvm(2677): Late-enabling CheckJNI

Repro:
1) fennec nightly, 03-12-2012 build, Galaxy Nexus
2) set up your Sync account with desktop Tab sync.  have more than 2 tabs open in tab browsing
3) open tabbed menu, and click "Synced Tabs"
4) Verify message in logcat:

03-13 09:23:38.439: ERROR/StrictMode(2295): class org.mozilla.gecko.AwesomeBar; instances=2; limit=1
03-13 09:23:38.439: ERROR/StrictMode(2295): android.os.StrictMode$InstanceCountViolation: class org.mozilla.gecko.AwesomeBar; instances=2; limit=1
03-13 09:23:38.439: ERROR/StrictMode(2295):     at android.os.StrictMode.setClassInstanceLimit(StrictMode.java:1)

Expected:
- no StrictMode error
nom for triage radar
blocking-fennec1.0: --- → ?
Tony, more log context would help. The strict mode warning ought to come with a stack trace.
k, working on a clean repro and will attach a full log to it
Attached file logcat
A fuller logcat.

More Repro:
1) create tab sync account, and have more than one tab open
2) launch tab tray, and click Synced Tabs
3) verify the android.os.StrictMode$InstanceCountViolation
4) If the above isnt enough, try these additional steps:

* go back to desktop, and launch another tab.  then sync.  then on fennec, force sync (since now a new tab should be created).   do step 1-2, and you'll get the error
* if not, force quit fennec and try again.   but its launching the synced tabs menu that shows the error.
blocking-fennec1.0: ? → +
Whiteboard: [sync]
Sriram, this looks familiar, though I think you were seeing it for GeckoApp, mm?

It's not a dupe of Bug 735137.

Based on a little reading, I'd guess that you're instantiating a second instance of RemoteTabs before the first one has been GCed.
Assignee: nobody → sriram
Summary: Clicking synced tabs link fires android.os.StrictMode$InstanceCountViolation error → ERROR/StrictMode: class org.mozilla.gecko.RemoteTabs; instances=2; limit=1 when clicking synced tabs link
Err, yeah.

    void showRemoteTabs() {
        Intent intent = new Intent(this, RemoteTabs.class);
        intent.putExtra("exit-to-tabs-tray", true);
        startActivity(intent);
        overridePendingTransition(R.anim.grow_fade_in, R.anim.shrink_fade_out);
        finishActivity();
    }

        mRemoteTabs.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                showRemoteTabs();
            }
        });


Every time you click that button, you instantiate a new RemoteTabs activity, and that's Verboten®.
Aah! I thought the problem was with AwesomeBar as it initially quoted.
But still, I don't have a control over instantiation of an activity. I just pass an intent. :(
Based on investigation:
* "singleInstance" can solve this issue. Every intent gets routed to onNewIntent() -- which can handle the refreshing of the activity.
* However, singleInstance moves the activity to a separate task and this activity will be alone in that stack. Therefore, when performing activity switching, we will result in weird UI problems. e.g.: http://cl.ly/2g0X2s3d3i1z3F0s1Z16
* singleTop and singleTask fails to handle the intent to onNewIntent(). Using moveTaskToBack(true), moves the entire stack to back, thereby Fennec goes out of view.

Based on @mbruckeck and @rnewman on IRC:
* The GC gets called when we do finish(). Sometimes, when open TabsTray or AwesomeBar or RemoteTabs faster, we end up in this issue, where Android has to create a _new_ instance before the old one is GC-ed. We don't have control over this. However, the old activity will be GC-ed soon. This is therefore a false alarm and nothing harmful.

Hence, we can ignore this false alarm.
(In reply to Sriram Ramasubramanian [:sriram] from comment #8)
> Hence, we can ignore this false alarm.

Don't ignore it -- turn it off.

http://developer.android.com/reference/android/os/StrictMode.html
I tried setting the class limit as specified here: http://developer.android.com/reference/android/os/StrictMode.VmPolicy.Builder.html#setClassInstanceLimit%28java.lang.Class,%20int%29

Even this doesn't seem to work. Probably singleTask resets the value to "1" while loading TabsTray/RemoteTabs.
> Based on @mbruckeck and @rnewman on IRC:
> * The GC gets called when we do finish(). Sometimes, when open TabsTray or
> AwesomeBar or RemoteTabs faster, we end up in this issue, where Android has
> to create a _new_ instance before the old one is GC-ed. We don't have
> control over this. However, the old activity will be GC-ed soon. This is
> therefore a false alarm and nothing harmful.
> 
> Hence, we can ignore this false alarm.

Based on this, we don't need to block on this bug. It would be nice to figure out why we can't seem to silence StrictMode output.
blocking-fennec1.0: + → -
Assignee: sriram → nobody
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: