Closed Bug 1590932 Opened 5 years ago Closed 5 years ago

Remote debugging can't pause at breakpoints since FF 71

Categories

(DevTools :: Debugger, defect, P1)

defect

Tracking

(firefox-esr68 unaffected, firefox67 unaffected, firefox68 unaffected, firefox69 unaffected, firefox70 wontfix, firefox71+ verified, firefox72 verified)

VERIFIED FIXED
Firefox 72
Tracking Status
firefox-esr68 --- unaffected
firefox67 --- unaffected
firefox68 --- unaffected
firefox69 --- unaffected
firefox70 --- wontfix
firefox71 + verified
firefox72 --- verified

People

(Reporter: daoshengmu, Assigned: jdescottes)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Thank you for helping make Firefox better. If you are reporting a defect, please complete the following:

What were you doing?

Using Remote Debugging to inspect JS code in GV browser (Firefox Reality).

Please tell us what site you were on, and what steps led to the error you are reporting
I guess Android phone also can reproduce this issue, you might not need a VR headset.

  1. Go to https://webvr.info/samples/XX-vr-controllers.html from an Android device.
  2. Open Remote debugging in FF 71 or FF 72, connect the device and choose inspect that *.html.
  3. Put breakpoints, it looks like the debugger detects it and wanna pause, but it is not paused on the breakpoints, and Watch expressions and Scopes show nothing.

What happened?

It is not paused on the breakpoints, and the watch expressions show nothing. It works at FF 70 but not work at FF 71 and 72.

What, if any, error messages did you see? Did the browser crash? Screenshots or screen recordings can be attached to this report and are helpful in isolating and replicating the bug.

What should have happened?

Was was the expected result? ("Not crashing" may be a valid answer.)
It should work as FF 70.

Anything else we should know?

Do you have extensions installed? You can also go to about:support in another window or tab and attach the report it generates to this bug.

@Julian, any tips how we could test this? I don't have an Android device.

Honza

Flags: needinfo?(jdescottes)

You can start another Firefox instance as a debugger server : https://gist.github.com/juliandescottes/b0d3d83154d9ea8a84db5d32aa35d2c1
The doc is slightly outdated, you don't need to set some of the prefs anymore. The tldr is: start a Firefox release with --start-debugger-server and with a profile that has the remote debugging / chrome debugging checkboxes ticked.

Edit: Might be a GeckoView only issue, just tried to debug Firefox Release from Nightly and it works fine. Let me check against Fenix

Flags: needinfo?(jdescottes)

daoshengmu: which version of GV are you trying to debug? You mention this works with a Fx70 client but not with a Fx71 or Fx72 client, however we need to know which server version is used here.

Flags: needinfo?(dmu)

Ok I think this is an issue with the new overlay feature which is using a client side only string. Which is not available on the server.

Flags: needinfo?(dmu)
Priority: -- → P1

@Julian, this is great, thanks for the analysis!

@Jason, can you please look at this?
It seem to be related to bug 1354679
See also: https://phabricator.services.mozilla.com/D38689

Honza

Flags: needinfo?(jlaster)
Blocks: dbg-72
Has STR: --- → yes

I will try to provide a patch we can uplift here, but we'll need another long term solution.

Technically we would need to move the "whyPaused" strings to a file that is available on mobile as well (eg devtools/shared/locales/en-US/debugger.properties instead of devtools/client/locales/en-US/debugger.properties). But that's 19 strings so not something we can do for an uplift.

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #1)

@Julian, any tips how we could test this? I don't have an Android device.

Honza

So to complete my answer, when a remote debugging issue is reported it can either be:

  • backward compatibility issue -> in this case you should be able to reproduce it with the setup I explained in my earlier comment
  • mobile Firefox issue -> in this case, if you can't easily build Fenix or the reference app (we have some docs for that in aboutdebugging), a good approximation is to remove the following code https://searchfox.org/mozilla-central/rev/088e2cf29c59d733d57af43903eb0267dbf72e2a/devtools/moz.build#10-14. This will build a Firefox Desktop but without the client devtools files. Then you start this Firefox with --start-debugger-server and target it from another Firefox desktop.

I should probably add a doc for that!

Keywords: regression
Regressed by: 1354679
Blocks: 1591025

Also note that the buttons displayed in the overlay are not rendered because they are also using client side files.

(In reply to Julian Descottes [:jdescottes] from comment #7)

I will try to provide a patch we can uplift here, but we'll need another long term solution.

Thanks for helping with this Julian!

Honza

Flags: needinfo?(jlaster)

"devtools/client/shared/locales" does not exist and only worked because l10n.js tries to fallback on devtools/client/locales/

Depends on D50453

Initially planned to simply add dummy English only string, eg "Paused" but considering that the buttons are also broken, I think the best move for now is to skip the higihlighter when we detect that we don't have the client files. Maybe in the long run we want an easy way to know that we are debugging a mobile device to show a different UI in this highlighter.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/593ddc2ba716 Fix wrong path to debugger.properties file r=jlast https://hg.mozilla.org/integration/autoland/rev/aae2aec5d6f5 Do not show the Paused highlighter when debugging Firefox mobile r=jlast
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Assignee: nobody → jdescottes

Comment on attachment 9103898 [details]
Bug 1590932 - Do not show the Paused highlighter when debugging Firefox mobile

Beta/Release Uplift Approval Request

  • User impact if declined: Cannot set breakpoints when debugging mobile builds of Firefox (Fenix, Firefox Reality ...) from Firefox 71
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: On mobile device, with Firefox Preview
  • enable USB debugging in Android settings
  • open Firefox Preview
  • enable USB debugging in the Firefox Preview Settings
  • open one tab in Firefox Preview (https://bug1590932-testcase.glitch.me/ but you cna use any page you want where you can set a breakpoint and hit it easily)
  • connect the phone to the computer with USB cable
    On Firefox Desktop
  • open about:debugging
  • in "Setup" tab make sure USB debugging is enabled
  • connect to the device from about:debugging
  • Inspect for the tab opened on Firefox Preview
  • Check that you can set a breakpoint and hit it (eg if you are using https://bug1590932-testcase.glitch.me/ , put a breakpoint in any log statement in script.js and click/touch the button)

Check that the breakpoint is reached, that you can step over, resume ... without the fix none of this works.

  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The fix is really conservative.
    We just fallback and disable the newly added UI of the Pause overlay if we detect that we retrieve the localized strings for this screen.
  • String changes made/needed: none
Attachment #9103898 - Flags: approval-mozilla-beta?
Attachment #9103897 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Hi, I tried to verify this issue and confirm the fix but after following the steps from Comment 15 it seems that its not pausing on breakpoints, The same scenario works on desktop browser with the same test page, after clicking "Click this button" it will automatically stop at the first breakpoint, stepping over also works as intended, but for some reason with the Firefox Preview on the android device it does not stop on breakpoint.
Debugger shows that it paused on breakpoint but Console shows all 3 console logs even though the breakpoint is set at the first Log(1).

Are we missing something here ? We are testing this issue on Windows 10 with Fx 72.0a1 (2019-10-28).

Flags: needinfo?(jdescottes)

(In reply to Rares Doghi from comment #16)

Hi, I tried to verify this issue and confirm the fix but after following the steps from Comment 15 it seems that its not pausing on breakpoints, The same scenario works on desktop browser with the same test page, after clicking "Click this button" it will automatically stop at the first breakpoint, stepping over also works as intended, but for some reason with the Firefox Preview on the android device it does not stop on breakpoint.
Debugger shows that it paused on breakpoint but Console shows all 3 console logs even though the breakpoint is set at the first Log(1).

Are we missing something here ? We are testing this issue on Windows 10 with Fx 72.0a1 (2019-10-28).

Ah the patch needs to be applied to the server version of Firefox, ie the version running on Android.
You probably are testing with a default Firefox Preview version? Can you validate patched versions of Firefox for Android?

If not I could provide Firefox Desktop builds that "simulate the issue", but I'm not sure it worth testing as I already verified it with this workaround.

Flags: needinfo?(jdescottes)
Flags: needinfo?(rares.doghi)

As discussed on Slack, the current Nightly Build of Firefox Preview doesn't include the fix.
Firefox Preview Nightly 191029 06:00 is based on Gecko 72.0a1-20191025095546 which was built a few hours before my fix reached central.
We need to wait for the next Firefox Preview Nightly to verify this.

Hi, I managed to Verify and Confirm this issue as Fixed in our latest Nightly build 72.0a1 (2019-10-30) on windows 10 using the Firefox Preview build id 72.0a1-20191029093803 on an android device. Thank you for the extra info Julian.

Flags: needinfo?(rares.doghi)

Comment on attachment 9103898 [details]
Bug 1590932 - Do not show the Paused highlighter when debugging Firefox mobile

Low risk, does not affect end-users, fix verified by QA on Nightly, uplift approved for 71 beta 6, thanks.

Attachment #9103898 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9103897 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Hi, This issue is verified as fixed in our latest beta build 71.0b6 on windows 10 using the Firefox Preview build id 72.0a1-20191029093803 on an android device. I will update the flags.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: