Closed Bug 1360819 Opened 8 years ago Closed 8 years ago

On Windows Nightly, PingSender shows terminal while browser is shutting down

Categories

(Toolkit :: Telemetry, defect, P1)

55 Branch
All
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla55
Tracking Status
firefox-esr45 --- unaffected
firefox-esr52 --- unaffected
firefox53 --- unaffected
firefox54 --- unaffected
firefox55 --- verified

People

(Reporter: ehoogeveen, Assigned: gsvelto)

References

Details

(Whiteboard: [measurement:client])

Attachments

(1 file, 1 obsolete file)

Just updated to the latest Nightly and got a bit worried when I saw a program popping up as I shut down the browser. My guess is that PingSender is built as a console application (/SUBSYSTEM:CONSOLE) when it should be a Windows application (/SUBSYSTEM:WINDOWS); this will prevent it from spawning a console unless you do it manually. I'm guessing this is a regression from the change in bug 1356673; maybe the way we spawned it before avoided this problem.
In Bug 1336360 "Use the PingSender for sending pings when the browser shuts down" See: https://bugzilla.mozilla.org/show_bug.cgi?id=1336360#c39 Alessio Placitelli [:Dexter] 2017-03-06 02:55:10 PST wrote: > Gabriele, I've noticed something interesting when trying the patch manually > on Windows. > > If I run and then shut down Firefox, the ping sender indeed gets called > (nothing odd here). However, a black command line prompt shows up for > just a second. Are you aware of any way to suppress that? This looks like a very similar issue. DJ-Leith
(In reply to DJ-Leith from comment #2) > In Bug 1336360 "Use the PingSender for sending pings when the browser shuts > down" > > See: https://bugzilla.mozilla.org/show_bug.cgi?id=1336360#c39 > > Alessio Placitelli [:Dexter] 2017-03-06 02:55:10 PST wrote: > > > Gabriele, I've noticed something interesting when trying the patch manually > > on Windows. > > > > If I run and then shut down Firefox, the ping sender indeed gets called > > (nothing odd here). However, a black command line prompt shows up for > > just a second. Are you aware of any way to suppress that? > > This looks like a very similar issue. > > DJ-Leith Aha,  It seems Mozilla made the same mistake. No automate test is provided :(
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
I'll take care of this, patch almost ready.
Flags: needinfo?(alessio.placitelli)
I've taken this from the crashreporter; it's not pretty but it works. Would there be a better way to do this? Possibly something related to bug 1223530?
Attachment #8863234 - Flags: feedback?(ted)
(In reply to Gabriele Svelto [:gsvelto] from comment #5) > Created attachment 8863234 [details] [diff] [review] > [PATCH WIP] Make the pingsender a GUI application on Windows > > I've taken this from the crashreporter; it's not pretty but it works. Would > there be a better way to do this? Possibly something related to bug 1223530? Could you maybe use CommandLineToArgvW (https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391.aspx)?
Priority: -- → P1
Whiteboard: [measurement:client]
Severity: normal → major
(In reply to Gabriele Svelto [:gsvelto] from comment #5) > Created attachment 8863234 [details] [diff] [review] > [PATCH WIP] Make the pingsender a GUI application on Windows > > I've taken this from the crashreporter; it's not pretty but it works. Would > there be a better way to do this? Possibly something related to bug 1223530? I'm not sure if this breaks anything else, but I found that adding the following line to pingsender_win.cpp (without any other change) > #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") solves the problem in a cleaner way, as it doesn't force us to define a WinMain function. I'm not sure if this introduces any other regression though, I quickly tested this locally on Windows and it seems to behave correctly.
Windows 7 64 bit and today's Nightly: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 I can reproduce this (the black command line prompt showing up for just a second in a window titled ping sender)
Gabriele, I caught up with Ted over IRC. Looks like the solution in comment 7 is ok. Would you mind producing a patch for that?
Flags: needinfo?(gsvelto)
I'm on it, just came out of paternity leave.
Flags: needinfo?(gsvelto)
Attachment #8863234 - Attachment is obsolete: true
Attachment #8863234 - Flags: feedback?(ted)
Comment on attachment 8864442 [details] Bug 1360819 - Do not show a console on Windows when launching the pingsender; https://reviewboard.mozilla.org/r/136118/#review139130 This looks good to me, thanks. Would you mind flagging QA to verify this on the different supported Windows platforms?
Attachment #8864442 - Flags: review?(alessio.placitelli) → review+
(In reply to Alessio Placitelli [:Dexter] from comment #12) > Comment on attachment 8864442 [details] > Bug 1360819 - Do not show a console on Windows when launching the pingsender; > > https://reviewboard.mozilla.org/r/136118/#review139130 > > This looks good to me, thanks. Would you mind flagging QA to verify this on > the different supported Windows platforms? Sure, I'm waiting for the try run to finish first though as there's a Windows failure that looks like an intermittent but I want to be 100% sure before landing.
Looking good, let's land this.
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7ab439a6b381 Do not show a console on Windows when launching the pingsender; r=Dexter
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Abe could you test this on Windows alone? The test case is: - Open Firefox, wait at least 1 minute; - Close Firefox - No console/terminal windows should be shown
Flags: needinfo?(amasresha)
FWI, I still see the console/terminal windows when closing Nightly using Windows 7 64 bit, User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0, Build ID 20170505030252
(In reply to Gabriela [:gaby2300] from comment #18) > FWI, I still see the console/terminal windows when closing Nightly using > Windows 7 64 bit, User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; > rv:55.0) Gecko/20100101 Firefox/55.0, Build ID 20170505030252 This fix didn't make it into that Nightly (see https://hg.mozilla.org/mozilla-central/file/0b255199db9d6a6f189b89b7906f99155bde3726/toolkit/components/telemetry/pingsender/pingsender_win.cpp ). It will be in the next Nightly! Thanks for checking this out though :)
Verified as FIXED starting from Mozilla Firefox Nightly 55.0a1 (2017-05-06). + clearing :ni
Flags: needinfo?(amasresha)
Version: Trunk → 55 Branch
Verified-fixed. Test cases are here: https://public.etherpad-mozilla.org/p/1360819
Thanks a lot Abe!
Blocks: 1362024
Depends on: 1364673
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: