Last Comment Bug 718703 - Sync crashes from Pair a Device link in sync settings
: Sync crashes from Pair a Device link in sync settings
Status: VERIFIED FIXED
:
Product: Android Background Services
Classification: Client Software
Component: Android Sync (show other bugs)
: unspecified
: ARM Android
: P1 blocker
: mozilla13
Assigned To: Chenxia Liu [:liuche] (inactive on Fennec, expect slow responses)
:
:
Mentors:
: 718713 720143 721913 725043 (view as bug list)
Depends on:
Blocks: 720934
  Show dependency treegraph
 
Reported: 2012-01-17 09:24 PST by Tony Chung [:tchung]
Modified: 2013-04-04 13:48 PDT (History)
16 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
verified
beta+
+


Attachments
Part 0: fix preprocessing of multiple files. v1 (1.55 KB, patch)
2012-01-31 16:15 PST, Richard Newman [:rnewman]
no flags Details | Diff | Splinter Review
Part 1: code. (13.04 KB, patch)
2012-01-31 16:16 PST, Richard Newman [:rnewman]
rnewman: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Splinter Review
Part 2: makefile change to preprocess sync_options.xml. v1 (3.35 KB, patch)
2012-01-31 16:16 PST, Richard Newman [:rnewman]
ted: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Splinter Review
Part 0: fix preprocessing of multiple files. v2 (1.83 KB, patch)
2012-02-01 02:13 PST, Richard Newman [:rnewman]
ted: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description Tony Chung [:tchung] 2012-01-17 09:24:31 PST
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
Comment 1 Tracy Walker [:tracy] 2012-01-17 10:16:30 PST
*** Bug 718713 has been marked as a duplicate of this bug. ***
Comment 2 Richard Newman [:rnewman] 2012-01-17 16:14:49 PST
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?
Comment 3 Tony Chung [:tchung] 2012-01-17 16:21:52 PST
(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
Comment 4 Tracy Walker [:tracy] 2012-01-17 16:24:47 PST
(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.
Comment 5 Richard Newman [:rnewman] 2012-01-17 17:12:10 PST
(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?
Comment 6 Tony Chung [:tchung] 2012-01-17 17:21:49 PST
FF 12.0a1 2012-01-16 mozilla-central nightly build.
Comment 7 Richard Newman [:rnewman] 2012-01-17 22:44:25 PST
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.
Comment 8 Aaron Train [:aaronmt] 2012-01-21 19:55:58 PST
*** Bug 720143 has been marked as a duplicate of this bug. ***
Comment 9 Tracy Walker [:tracy] 2012-01-25 07:50:30 PST
update summary to better describe where crash occurs.
Comment 10 Andreea Pod 2012-01-27 06:41:31 PST
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)
Comment 11 Tracy Walker [:tracy] 2012-01-27 06:50:53 PST
Andrea, I believe various devices/android versions are behaving slightly differently but essentially all crash in some manner.
Comment 12 Chenxia Liu [:liuche] (inactive on Fennec, expect slow responses) 2012-01-30 23:28:01 PST
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
Comment 13 Richard Newman [:rnewman] 2012-01-31 15:45:27 PST
Merged to develop:

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

Will upload a Makefile patch after I've tested it.
Comment 14 Richard Newman [:rnewman] 2012-01-31 15:46:25 PST
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.
Comment 15 Richard Newman [:rnewman] 2012-01-31 16:15:43 PST
Created attachment 593260 [details] [diff] [review]
Part 0: fix preprocessing of multiple files. v1

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.
Comment 16 Richard Newman [:rnewman] 2012-01-31 16:16:11 PST
Created attachment 593261 [details] [diff] [review]
Part 1: code.
Comment 17 Richard Newman [:rnewman] 2012-01-31 16:16:45 PST
Created attachment 593262 [details] [diff] [review]
Part 2: makefile change to preprocess sync_options.xml. v1
Comment 18 Mozilla RelEng Bot 2012-01-31 21:00:46 PST
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
Comment 19 Richard Newman [:rnewman] 2012-01-31 23:57:26 PST
Comment on attachment 593260 [details] [diff] [review]
Part 0: fix preprocessing of multiple files. v1

Drat. I think this is wrong.
Comment 20 Richard Newman [:rnewman] 2012-02-01 02:13:46 PST
Created attachment 593356 [details] [diff] [review]
Part 0: fix preprocessing of multiple files. v2

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!
Comment 22 Richard Newman [:rnewman] 2012-02-03 13:13:02 PST
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.
Comment 23 Tony Chung [:tchung] 2012-02-03 16:10:15 PST
I've verified this fix on a try build, and it's no longer crashing.  Will recheck when it hits the channels.
Comment 24 Richard Newman [:rnewman] 2012-02-03 16:43:34 PST
(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.
Comment 25 Tony Chung [:tchung] 2012-02-03 16:48:15 PST
(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!
Comment 26 Alex Keybl [:akeybl] 2012-02-05 14:06:16 PST
Comment on attachment 593261 [details] [diff] [review]
Part 1: code.

[Triage Comment]
Mobile only - approving for Aurora 12 and Beta 11.
Comment 28 Brad Lassey [:blassey] (use needinfo?) 2012-02-06 14:23:24 PST
Richard, can you please land these on beta today?
Comment 29 Richard Newman [:rnewman] 2012-02-06 14:32:10 PST
(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?
Comment 30 Tracy Walker [:tracy] 2012-02-07 09:17:38 PST
verified with Aurora nightly of 20120207
Comment 31 Richard Newman [:rnewman] 2012-02-07 21:10:22 PST
*** Bug 725043 has been marked as a duplicate of this bug. ***
Comment 32 Tony Chung [:tchung] 2012-04-13 00:00:24 PDT
*** Bug 721913 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.