New issue
Advanced search Search tips

Issue 826743 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-05-02
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression

Blocked on:
issue 910302

Blocking:
issue 750327



Sign in to add a comment

third_party/unrar has issues

Project Member Reported by thakis@chromium.org, Mar 28 2018

Issue description

1. It uses exceptions. No shipping chromium code must use exceptions.
2. https://chromium-review.googlesource.com/c/chromium/src/+/907789 modified upstream unrar fairly heavily without documenting this as required for third-party libraries.

1 is probably harder to sort out and might mean we can't use this library.
 

Comment 1 by thakis@chromium.org, Mar 28 2018

Blocking: 750327

Comment 2 by vakh@chromium.org, Mar 28 2018

Labels: OS-Chrome OS-Linux OS-Windows
Thanks for highlighting the issues. I wasn't aware of 2 at all.

Pasting https://chromium-review.googlesource.com/c/chromium/src/+/907789#message-20ab9debcc5a5ac6ffca1643ecdc9c0934bc4143 verbatim:

Also, it looks like this modifies the library code heavily, without mentioning that in README.chromium or adding a .patch file (see https://src.chromium.org/viewvc/chrome/trunk/src/third_party/README.chromium.template ; linked to from https://chromium.googlesource.com/chromium/src.git/+/master/docs/adding_to_third_party.md#Add-a-README_chromium )

Comment 3 by thakis@chromium.org, Mar 28 2018

(The motivation for (2) is that we want to be able to update third-party libraries from upstream easily. So ideally we wouldn't need local changes and would do changes upstream, but if we do we need to clearly document them so they can be replayed after the next update)

Comment 4 by thakis@chromium.org, Apr 13 2018

Any progress here? Can we remove unrar from the build until this is fixed?

Comment 5 by vakh@chromium.org, Apr 13 2018

The feature that uses unrar isn't enabled by default or via Finch so that code isn't getting executed today, unless enabled specifically using a command line flag.

I'll come back to fixing this after a week.

Comment 6 by thakis@chromium.org, Apr 13 2018

It's still bad to have code compiling with -fexceptions as part of the build, since it other people will find it in codesearch.

Comment 7 by vakh@chromium.org, Apr 13 2018

I agree. I can add a comment next to "//build/config/compiler:exceptions" to discourage it's use and reference this bug there. That should solve this concern for the super-short term. Would that be OK?

Comment 8 by vakh@chromium.org, Apr 13 2018

s/it's/its

Comment 9 by thakis@chromium.org, Apr 16 2018

If there's a plan to move off exceptions for unrar that can be implemented in a month or so, that sounds fine.

Comment 10 by vakh@chromium.org, Apr 27 2018

NextAction: 2018-04-30
The NextAction date has arrived: 2018-04-30

Comment 12 by vakh@chromium.org, Apr 30 2018

I'm starting to look at this now.

Regarding exceptions
--------------------
I am looking into whether removing exceptions is viable. The code appears to use them in multiple places and removing that might be tricky since there are no tests to ensure it doesn't break anything.

I don't know if there's a standard replacement for throw.

Regarding patches
-----------------
I still have the original source code so generating a .diff file between the code in the repo and the original code would be straightforward but it would be the reverse of what we need here. I'm going to look into generating this reverse diff somehow. Initial searching on Google hasn't revealed anything particularly useful.

Comment 13 by vakh@chromium.org, May 1 2018

Cc: thakis@chromium.org
Components: Services>Safebrowsing
Labels: SafeBrowsing-Triaged
Regarding exceptions
--------------------
I found a good workaround. Instead of throw, I can do this:

+#if defined(CHROMIUM_UNRAR)
+  base::Process::Current().Terminate(Code, false);
+#else
   throw Code;
+#endif  // CHROMIUM_UNRAR

Since the library only runs within the sandbox, the sandbox process dies and the calling code handles this situation in an appropriate manner.
I ran this locally and it works as expected.

thakis@ -- do you have any thoughts on this?

Comment 14 by vakh@chromium.org, May 1 2018

NextAction: 2018-05-02

Comment 15 by vakh@chromium.org, May 1 2018

See: https://chromium-review.googlesource.com/#/c/chromium/src/+/1038141 for what I describe in #c13

Comment 16 by vakh@chromium.org, May 1 2018

Status: Started (was: Assigned)
The NextAction date has arrived: 2018-05-02
Comment 13 sounds fine to me, but I'd feel better about it if that could make it upstream behind a "UNRAR_NO_EXCEPTIONS" define or some such, so that we don't have a big downstream diff because of it.
Project Member

Comment 19 by bugdroid1@chromium.org, May 3 2018

Comment 20 by vakh@chromium.org, May 3 2018

#c19 fixes the exceptions issue.

I'm still looking for a good way to generate the patch.

Comment 21 by vakh@chromium.org, May 22 2018

Labels: -Pri-1 Pri-2
Project Member

Comment 22 by bugdroid1@chromium.org, Nov 5

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

commit f9f3ebcea00305663a47c0217cee260fd74c7f0b
Author: Nico Weber <thakis@chromium.org>
Date: Mon Nov 05 20:33:03 2018

clang/win: Remove #pragma hdrstop workaround.

clang-cl supports #pragma hdrstop as of r341963.

Bug:  505314 , 504657 ,750327,826743
Change-Id: Ic90b07114bbb886b7d8345a260863f45eef352b7
Reviewed-on: https://chromium-review.googlesource.com/c/1317607
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605445}
[modify] https://crrev.com/f9f3ebcea00305663a47c0217cee260fd74c7f0b/third_party/unrar/src/global.cpp

Blockedon: 910302

Sign in to add a comment