New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 805443 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression

Blocking:
issue 800808
issue 806590



Sign in to add a comment

chrome --version is not working properly any more

Project Member Reported by cmt...@chromium.org, Jan 24 2018

Issue description

Someone broke the output of "chrome --version"  between 65.0.3322.0 and 65.0.3323.0 (at least on ChromeOS).

It used to output the version on stdout, which we rely on, as we have scripts that read this version and use it for appropriate naming of files (such as the perf data files we use for AFDO compilations).

You can see the weird behavior by logging into a Chromebook:


localhost ~ # /opt/google/chrome/chrome --version                                       
Google Chrome 65.0.3325.11 unknown
localhost ~ # /opt/google/chrome/chrome --version > /tmp/chrome-version.2.txt
localhost ~ # ls /tmp/chrome-version.2.txt                                              
/tmp/chrome-version.2.txt
localhost ~ # more /tmp/chrome-version.2.txt
localhost ~ #
localhost ~ # /opt/google/chrome/chrome --version &> /tmp/chrome-version.2.txt          
localhost ~ # more /tmp/chrome-version.2.txt
localhost ~ #
localhost ~ # wc /tmp/chrome-version.2.txt                                              
0 0 0 /tmp/chrome-version.2.txt
localhost ~ # /opt/google/chrome/chrome --version | grep Google
localhost ~ #

This needs to be fixed ASAP, as it's breaking the AFDO builds and will cause the PFQ to start failing if it isn't fixed in the next few days.


 

Comment 1 by cmt...@chromium.org, Jan 24 2018

Cc: marcochen@chromium.org shapiroc@chromium.org bmgordon@chromium.org warx@chromium.org
I don't know what the right component or label or owner is for this issue, so I'm adding the current gardener/sheriffs in the hopes they can assign it properly.

(BTW, you can see that the Chrome version is not actually being written out if you use strace).

Comment 2 by vapier@chromium.org, Jan 24 2018

Cc: vapier@chromium.org
simple reproducer is:
# /opt/google/chrome/chrome --version
<get output>
# /opt/google/chrome/chrome --version | cat
<no output with 65.0.3323.0+>

Comment 3 by cmt...@chromium.org, Jan 24 2018

Cc: laszio@chromium.org llozano@chromium.org

Comment 4 by warx@chromium.org, Jan 24 2018

Owner: warx@chromium.org
Status: Assigned (was: Untriaged)
I can take a look

Comment 5 by warx@chromium.org, Jan 24 2018

Cc: gab@chromium.org
bisect shows the culprit CL is: https://chromium.googlesource.com/chromium/src/+/19a74a4e72ee85c2c24336a7bb5f2024523ca8bd

Comment 6 by warx@chromium.org, Jan 24 2018

Looks like the author gab@ is in UTC time. I will revert the CL: https://chromium-review.googlesource.com/c/chromium/src/+/883603 now.
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00d4c5682096bf92e821637a697628fc40d9915c

commit 00d4c5682096bf92e821637a697628fc40d9915c
Author: Qiang(Joe) Xu <warx@chromium.org>
Date: Wed Jan 24 18:36:13 2018

Revert "TerminateProcess instead of letting main unwind."

This reverts commit 19a74a4e72ee85c2c24336a7bb5f2024523ca8bd.

Reason for revert:  crbug.com/805443 

Original change's description:
> TerminateProcess instead of letting main unwind.
>
> Avoids going through wasteful and often problematic static
> uninitialization phase.
>
> Unfortunately can't do this in ContentMain because of embedders (namely
> test frameworks).
>
> Bug: 800808
> Change-Id: I768b096a8dbea4804a94d0d50e7345d46c9ef781
> Reviewed-on: https://chromium-review.googlesource.com/860617
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#529233}

TBR=gab@chromium.org,jochen@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 800808, 805443 
Change-Id: Icb7b027db65ee5e39f240d52f13e9a025edc76cf
Reviewed-on: https://chromium-review.googlesource.com/883603
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Reviewed-by: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531616}
[modify] https://crrev.com/00d4c5682096bf92e821637a697628fc40d9915c/chrome/app/chrome_main.cc

Components: Internals>TaskScheduler

Comment 9 by vapier@chromium.org, Jan 24 2018

in that case, my guess would be that it exits w/out flushing any of its stdio handles.  it probably should add a fflush(stdout); fflush(stderr); before terminating immediately.
A better fix might be to flush stdout / stderr in the --version handler, not during shutdown. (Somewhat surprising that --version doesn't just exit after printing and instead goes to the regular chrome shutdown path)
i'm not sure that's a good idea.  you're suggesting every point in the code that writes to stdout/stderr during the main startup needs defensively flush stdio ?  that would include all CHECK related statements too.

what is the concern with just calling fflush at this point in main ?  if there's nothing to flush, then the calls should be pretty cheap (since the FILE handles are all in userspace/the C library), and if there is something to flush, it better well be flushed before we exit hard.
One of the intents with termination is that it happens immediately and after all blocking tasks are flushed. A sustainable workaround may be to post a BLOCK_SHUTDOWN task to flush the streams.

The tricky part about this is that for correctness, this needs to happen after all tasks blocking shutdown have run or it could be racy.

Comment 13 by warx@chromium.org, Jan 24 2018

Cc: -warx@chromium.org -gab@chromium.org
Owner: gab@chromium.org
Revert landed in tot. Problem is fixed.

I will delegate to cl owner for follow up fix.

Comment 14 by gab@chromium.org, Jan 25 2018

Blocking: 800808
Labels: -Pri-1 Pri-3
Status: Available (was: Assigned)
I will not realistically have cycles to look into this shortly.

Feel free to grab from me if interested. robliao's approach of posting a BLOCK_SHUTDOWN task to flush buffers SGTM. Ideally would run last among BLOCK_SHUTDOWN tasks though. Ping me for ideas on how to do that.

Cheers,
Gab
Cc: susanjun...@techmahindra.com thomasanderson@chromium.org
 Issue 809020  has been merged into this issue.
 Issue 810805  has been merged into this issue.
Labels: -Type-Bug Merge-Request-65 RegressedIn-65 Type-Bug-Regression
Requesting merge for the revert to M-65. This broke in 65.0.3323.0.
Project Member

Comment 18 by sheriffbot@chromium.org, Feb 9 2018

Labels: -Merge-Request-65 Merge-Review-65 Hotlist-Merge-Review
This bug requires manual review: Reverts referenced in bugdroid comments after merge request.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Pri-3 Pri-1
I believe this is P1, as beta is being affected.

Comment 20 by gab@chromium.org, Feb 10 2018

Labels: M-65 ReleaseBlock-Beta
Agreed, let's revert on branch as well.
Labels: -Hotlist-Merge-Review -ReleaseBlock-Beta -Merge-Review-65 ReleaseBlock-Stable Merge-Approved-65
Project Member

Comment 22 by bugdroid1@chromium.org, Feb 13 2018

Labels: -merge-approved-65 merge-merged-3325
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/23c73d55a5e5dc485a7bb02fece033d1d6987063

commit 23c73d55a5e5dc485a7bb02fece033d1d6987063
Author: Qiang(Joe) Xu <warx@chromium.org>
Date: Tue Feb 13 07:34:32 2018

[Merge M65] Revert "TerminateProcess instead of letting main unwind."

This reverts commit 19a74a4e72ee85c2c24336a7bb5f2024523ca8bd.

Reason for revert:  crbug.com/805443 

Original change's description:
> TerminateProcess instead of letting main unwind.
>
> Avoids going through wasteful and often problematic static
> uninitialization phase.
>
> Unfortunately can't do this in ContentMain because of embedders (namely
> test frameworks).
>
> Bug: 800808
> Change-Id: I768b096a8dbea4804a94d0d50e7345d46c9ef781
> Reviewed-on: https://chromium-review.googlesource.com/860617
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#529233}

TBR=gab@chromium.org,jochen@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 800808, 805443 
Change-Id: Icb7b027db65ee5e39f240d52f13e9a025edc76cf
Reviewed-on: https://chromium-review.googlesource.com/883603
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Reviewed-by: Qiang(Joe) Xu <warx@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#531616}(cherry picked from commit 00d4c5682096bf92e821637a697628fc40d9915c)
Reviewed-on: https://chromium-review.googlesource.com/915063
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#443}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
[modify] https://crrev.com/23c73d55a5e5dc485a7bb02fece033d1d6987063/chrome/app/chrome_main.cc

Facing the same issue with chrome beta channel

Comment 24 by gab@chromium.org, Feb 14 2018

This will be fixed in 65.0.3325.70+ (current Beta is 65.0.3325.51, next release should happen in next few days).

Comment 25 by gab@chromium.org, Feb 14 2018

Status: Fixed (was: Available)

Comment 26 by gab@chromium.org, Feb 24 2018

Blocking: 806590

Sign in to add a comment