Closed Bug 718703 Opened 12 years ago Closed 12 years ago

Sync crashes from Pair a Device link in sync settings

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P1)

ARM
Android
defect

Tracking

(firefox11 fixed, firefox12 verified, blocking-fennec1.0 beta+, fennec+)

VERIFIED FIXED
mozilla13
Tracking Status
firefox11 --- fixed
firefox12 --- verified
blocking-fennec1.0 --- beta+
fennec + ---

People

(Reporter: tchung, Assigned: liuche)

References

Details

Attachments

(3 files, 1 obsolete file)

When setting up Pair a device, Sync app crashes.

01-17 08:43:34.347: WARN/TextLayoutCache(1301): computeValuesWithHarfbuzz -- need to force to single run
01-17 08:43:34.495: DEBUG/OpenGLRenderer(1301): Flushing caches (mode 0)
01-17 08:43:34.699: INFO/ActivityManager(205): Displayed com.android.settings/.SubSettings: +664ms
01-17 08:43:35.292: DEBUG/AndroidRuntime(1301): Shutting down VM
01-17 08:43:35.292: WARN/dalvikvm(1301): threadid=1: thread exiting with uncaught exception (group=0x40a3a1f8)
01-17 08:43:35.292: INFO/ActivityManager(205): START {act=android.intent.action.MAIN flg=0x10000000 cmp=org.mozilla.gecko/.sync.setup.activities.SetupSyncActivity (has extras)} from pid 1301
01-17 08:43:35.300: ERROR/AndroidRuntime(1301): FATAL EXCEPTION: main
01-17 08:43:35.300: ERROR/AndroidRuntime(1301): android.content.ActivityNotFoundException: Unable to find explicit activity class {org.mozilla.gecko/org.mozilla.gecko.sync.setup.activities.SetupSyncActivity}; have you declared this activity in your AndroidManifest.xml?
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.app.ContextImpl.startActivity(ContextImpl.java:852)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.preference.Preference.performClick(Preference.java:957)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:202)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.widget.AdapterView.performItemClick(AdapterView.java:292)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.widget.AbsListView.performItemClick(AbsListView.java:1058)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:2514)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.widget.AbsListView$1.run(AbsListView.java:3168)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.os.Handler.handleCallback(Handler.java:605)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.os.Looper.loop(Looper.java:137)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at android.app.ActivityThread.main(ActivityThread.java:4340)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at java.lang.reflect.Method.invokeNative(Native Method)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at java.lang.reflect.Method.invoke(Method.java:511)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-17 08:43:35.300: ERROR/AndroidRuntime(1301):     at dalvik.system.NativeStart.main(Native Method)
01-17 08:43:35.316: WARN/ActivityManager(205):   Force finishing activity com.android.settings/.SubSettings
01-17 08:43:35.402: INFO/WindowManager(205): createSurface Window{41b9bde0  paused=false}: DRAW NOW PENDING
01-17 08:43:35.878: WARN/ActivityManager(205): Activity pause timeout for ActivityRecord{41ae2208 com.android.settings/.SubSettings}
01-17 08:43:40.425: DEBUG/dalvikvm(32439): GC_CONCURRENT freed 461K, 54% free 15754K/33991K, paused 3ms+3ms
01-17 08:43:45.378: WARN/ActivityManager(205): Launch timeout has expired, giving up wake lock!
01-17 08:43:45.886: WARN/ActivityManager(205): Activity idle timeout for ActivityRecord{41919400 com.android.settings/.SubSettings}
01-17 08:43:51.113: WARN/ActivityManager(205): Activity destroy timeout for ActivityRecord{41ae2208 com.android.settings/.SubSettings}

Repro:
1) install fennec nightly 1-17-2012 build
2) setup sync successfully on mobile
3) launch sync settings, and go to Pair a Device option
4) Verify Crash with log abo e

Expected:
- no crash
tracking-fennec: --- → ?
Blocks: 717849
Assignee: nobody → liuche
Status: NEW → ASSIGNED
Priority: -- → P1
No longer blocks: 717849
After some investigation on Marina's machine, it looks like some changes aren't getting picked up by manifests. I'm not sure why that would be.

Do you see a launcher icon for "Firefox Sync", Tony?
(In reply to Richard Newman [:rnewman] from comment #2)
> After some investigation on Marina's machine, it looks like some changes
> aren't getting picked up by manifests. I'm not sure why that would be.
> 
> Do you see a launcher icon for "Firefox Sync", Tony?

do you mean under apps or the acccount settings?

repro:
1) open accounts & sync
2) choose the firefox sync account that's already setup
3) on the firefox sync, click Pair a Device.
4) see logcat voila.  aaron reproduced it also on bug 718713
(In reply to Richard Newman [:rnewman] from comment #2)
> After some investigation on Marina's machine, it looks like some changes
> aren't getting picked up by manifests. I'm not sure why that would be.
> 
> Do you see a launcher icon for "Firefox Sync", Tony?

Yes, the Firefox Sync launcher icon is available in the Applications list.
(In reply to Tony Chung [:tchung] from comment #3)

> do you mean under apps or the acccount settings?

Under apps.

Precisely which build do you have installed?
FF 12.0a1 2012-01-16 mozilla-central nightly build.
Here's one source of possible causes:

http://stackoverflow.com/questions/3433778/android-content-activitynotfoundexception

Bug 718928 is another possible cause. If we eliminate the latter, then we should explore the former. RuntimeExceptions seems plausible.
tracking-fennec: ? → +
update summary to better describe where crash occurs.
Summary: Sync crashes on Pairing a Device → Sync crashes from Pair a Device link in sync settings
When I tap on "Pair a device" in settings Android restarts, is this the same behavior? 

Mozilla /5.0 (Android;Linux armv7l;rv:11.0a2) Gecko/20120126 Firefox/11.0a2 Fennec/11.0a2
Device: Motorola Droid2 (Android 2.3), Samsung Galaxy S2 (Android 2.3)
Andrea, I believe various devices/android versions are behaving slightly differently but essentially all crash in some manner.
Figured this bug out - when pairing a device, we specify a package and a class in res/xml/sync_options.xml, but since Android Sync is bundled with Fennec, the package incorrectly specifies the Android Sync package.

Substituting the generated package (org.mozilla.fennec_liuche) and then bundling with Fennec will not cause a crash on "Pair a Device."

Code fix on github, minus Makefile foo to make it build nicely with Fennec:
https://github.com/mozilla-services/android-sync/pull/44/files
Merged to develop:

https://github.com/mozilla-services/android-sync/commit/ecc3391cf05e79d1b51f5ac115bdb73406d4cabf

Will upload a Makefile patch after I've tested it.
Note that -- because this is partly a packaging thing -- this'll need to be tested as part of a real build before we can really draw a line under it.
This doesn't seem like the best way to do this, but the way it was didn't work when PP_RES_XML included more than one file.
Attachment #593260 - Flags: review?(ted.mielczarek)
Attached patch Part 1: code.Splinter Review
Attachment #593261 - Flags: review+
Try run for 0e2d59ecbaf8 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=0e2d59ecbaf8
Results (out of 55 total builds):
    exception: 2
    success: 48
    warnings: 4
    failure: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/rnewman@mozilla.com-0e2d59ecbaf8
Blocks: 720934
Comment on attachment 593260 [details] [diff] [review]
Part 0: fix preprocessing of multiple files. v1

Drat. I think this is wrong.
Attachment #593260 - Flags: review?(ted.mielczarek)
There, I think that's better.

Note that we actually make the list of output files depend on the list of input files; if any input changes, we rebuild the output. I don't know a non-invasive way to change that (i.e., without defining a search path for all .xml/.xml.in pairings).

Because of this we can't use $< -- we end up preprocessing file A.xml.in into B.xml, depending on how the dependencies are computed. Instead we re-substitute $@. We might do a tiny bit of redundant work, but at least it's correct!

I used patsubst instead of the original line with .in at the end; that worked fine with a single file, but broke when I added another. I don't know why that line was written as it was, so I hope this still makes sense!
Attachment #593260 - Attachment is obsolete: true
Attachment #593356 - Flags: review?(ted.mielczarek)
Attachment #593356 - Attachment is patch: true
Attachment #593356 - Flags: review?(ted.mielczarek) → review+
Attachment #593262 - Flags: review?(ted.mielczarek) → review+
Comment on attachment 593261 [details] [diff] [review]
Part 1: code.

[Approval Request Comment]
User impact if declined: crashes and unhappiness.
Testing completed (on m-c, etc.): about to hit QA.
Risk to taking this patch (and alternatives if risky): no alternative.
Attachment #593261 - Flags: approval-mozilla-beta?
Attachment #593261 - Flags: approval-mozilla-aurora?
Attachment #593262 - Flags: approval-mozilla-beta?
Attachment #593262 - Flags: approval-mozilla-aurora?
Attachment #593356 - Flags: approval-mozilla-beta?
Attachment #593356 - Flags: approval-mozilla-aurora?
I've verified this fix on a try build, and it's no longer crashing.  Will recheck when it hits the channels.
(In reply to Tony Chung [:tchung] from comment #23)
> I've verified this fix on a try build, and it's no longer crashing.  Will
> recheck when it hits the channels.

The build I pointed you to was mozilla-central.
(In reply to Richard Newman [:rnewman] from comment #24)
> (In reply to Tony Chung [:tchung] from comment #23)
> > I've verified this fix on a try build, and it's no longer crashing.  Will
> > recheck when it hits the channels.
> 
> The build I pointed you to was mozilla-central.

ah, hourly tinderbox build.  even better!
Status: RESOLVED → VERIFIED
Comment on attachment 593261 [details] [diff] [review]
Part 1: code.

[Triage Comment]
Mobile only - approving for Aurora 12 and Beta 11.
Attachment #593261 - Flags: approval-mozilla-beta?
Attachment #593261 - Flags: approval-mozilla-beta+
Attachment #593261 - Flags: approval-mozilla-aurora?
Attachment #593261 - Flags: approval-mozilla-aurora+
Attachment #593262 - Flags: approval-mozilla-beta?
Attachment #593262 - Flags: approval-mozilla-beta+
Attachment #593262 - Flags: approval-mozilla-aurora?
Attachment #593262 - Flags: approval-mozilla-aurora+
Attachment #593356 - Flags: approval-mozilla-beta?
Attachment #593356 - Flags: approval-mozilla-beta+
Attachment #593356 - Flags: approval-mozilla-aurora?
Attachment #593356 - Flags: approval-mozilla-aurora+
Richard, can you please land these on beta today?
(In reply to Brad Lassey [:blassey] from comment #28)
> Richard, can you please land these on beta today?

Looks like somebody already did:

changeset:   85250:43c32738dba2
user:        Richard Newman <rnewman@mozilla.com>
date:        Fri Feb 03 13:09:28 2012 -0800
summary:     Bug 718703 - Part 2: makefile change to preprocess sync_options.xml. r=ted

changeset:   85249:542289913961
user:        Richard Newman <rnewman@mozilla.com>
date:        Fri Feb 03 13:09:28 2012 -0800
summary:     Bug 718703 - Part 1: Sync crashes from Pair a Device link in sync settings. r=rnewman

changeset:   85243:088774d5dd19
user:        Richard Newman <rnewman@mozilla.com>
date:        Fri Feb 03 13:09:28 2012 -0800
summary:     Bug 718703 - Part 0: Makefile fix for preprocessing multiple files. r=ted


Do you see something different in your mozilla-beta checkout?
verified with Aurora nightly of 20120207
blocking-fennec1.0: --- → beta+
Target Milestone: --- → mozilla13
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.