Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Issue 10070010: validator_ragel: Link into TCB, use under env var (Closed)

Created:
8 years, 8 months ago by pasko-google - do not use
Modified:
8 years, 8 months ago
Reviewers:
Nick Bray, Mark Seaborn
CC:
native-client-reviews_googlegroups.com, Mark Seaborn
Visibility:
Public.

Description

validator_ragel: Link into TCB, use under env var In both Chrome and sel_ldr environment variable NACL_DANGEROUS_USE_DFA_VALIDATOR is used to replace the current validator with the new one. WARNING: WARNING: WARNING: The size increase of the runnable binaries resulted by this change will likely trigger the "perf_expectation" regression when this change gets pulled into Chrome via DEPS roll. Size implications: 0. absolute values of size increase are equal among sel_ldr, nacl_helper and the chrome binary. On Linux the validator library gets pulled into the downloadable chrome package twice (in nacl_helper and chrome). 1. 32bit validator size is negligible (within 40K on each platform uncompressed) 2. with 64 validator there are 2 cases: Linux and Windows. 2.1. On Linux the optimized stripped sel_ldr gets increased by 400K (was: 510K). The 7zipped size increase for nacl_helper is 108K (was: 884K). 2.2. On Windows the optimized sel_ldr gets increased by 1MB (was: 955K). When 7zipped the increase is 101K (great compression!). When we get to optimize the Windows64 build the uncompressed size increase is expected to be significantly smaller: about 350K. This is a work in progress. Overall package size increase is expected to be: Windows64: 7zipped - about 101K uncompressed - about 1MB (can be reduced later) Linux64: 7zipped - about 216K uncompressed - about 800K Windows32, all MacOS variants: uncompressed - less than 40K Linux32: uncompressed - less than 80K Linking another validator in statically has the advantage of being able to run two validators side by side for some time taking the current validator's answer as authoritative. Also, it does not increase the hassle in the build and deployment systems which we have a lot already. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2597 TEST=./scons --mode=dbg-host platform=x86-64 run_dfa_validator_hello_world_test Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=8372

Patch Set 1 #

Patch Set 2 : . #

Total comments: 32

Patch Set 3 : some changes according to review #

Patch Set 4 : merged cleanup around library_deps.py #

Patch Set 5 : incorrect merge fixed #

Patch Set 6 : merge sb_kind removal #

Patch Set 7 : Move validator selection in a function, don't create a stub function for the ARM validator. #

Patch Set 8 : revert introducing extra empty line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -27 lines) Patch
M site_scons/site_tools/library_deps.py View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/arch/x86/service_runtime_x86.gyp View 3 chunks +4 lines, -1 line 0 comments Download
M src/trusted/service_runtime/build.scons View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_ldr.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_ldr.c View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_main.c View 1 chunk +6 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_main_chrome.c View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_validate_image.c View 1 2 3 4 5 6 7 2 chunks +30 lines, -18 lines 0 comments Download
A src/trusted/service_runtime/testdata/dfa_validator_hello.stderr View 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/validator/ncvalidate.h View 1 2 3 4 5 1 chunk +16 lines, -0 lines 0 comments Download
M src/trusted/validator/x86/64/validator_x86_64.gyp View 1 chunk +1 line, -1 line 0 comments Download
M src/trusted/validator_ragel/build.scons View 1 chunk +24 lines, -7 lines 0 comments Download
A src/trusted/validator_ragel/dfa_validator_x86_32.gyp View 1 chunk +32 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/dfa_validator_x86_64.gyp View 1 chunk +44 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/dfa_validate_32.c View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/dfa_validate_64.c View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
pasko-google - do not use
8 years, 8 months ago (2012-04-19 22:01:14 UTC) #1
Mark Seaborn
http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/sel_main_chrome.h File src/trusted/service_runtime/sel_main_chrome.h (right): http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/sel_main_chrome.h#newcode64 src/trusted/service_runtime/sel_main_chrome.h:64: int enable_dfa_validator; I don't think this belongs here. Chromium ...
8 years, 8 months ago (2012-04-19 22:11:39 UTC) #2
pasko-google - do not use
http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/sel_main_chrome.h File src/trusted/service_runtime/sel_main_chrome.h (right): http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/sel_main_chrome.h#newcode64 src/trusted/service_runtime/sel_main_chrome.h:64: int enable_dfa_validator; On 2012/04/19 22:11:39, Mark Seaborn wrote: > ...
8 years, 8 months ago (2012-04-19 22:36:26 UTC) #3
Nick Bray
Here's some high-level advice. Feel free to debate, a lot of it is based on ...
8 years, 8 months ago (2012-04-19 23:11:07 UTC) #4
pasko-google - do not use
http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): http://codereview.chromium.org/10070010/diff/1025/src/trusted/service_runtime/build.scons#newcode769 src/trusted/service_runtime/build.scons:769: env.AddNodeToTestSuite(node, ['medium_tests'], On 2012/04/19 23:11:08, Nick Bray wrote: > ...
8 years, 8 months ago (2012-04-20 14:30:38 UTC) #5
pasko-google - do not use
Merged Mark's comments from https://chromiumcodereview.appspot.com/10158002 PTAL
8 years, 8 months ago (2012-04-20 16:41:21 UTC) #6
Nick Bray
> across all trusted code I do not see a single #ifdef ARM, is it ...
8 years, 8 months ago (2012-04-23 04:30:17 UTC) #7
pasko-google - do not use
On 2012/04/23 04:30:17, Nick Bray wrote: > > across all trusted code I do not ...
8 years, 8 months ago (2012-04-23 16:55:01 UTC) #8
Nick Bray
8 years, 8 months ago (2012-04-24 00:24:47 UTC) #9
> Oops. I did not think over these details. Sounds pretty bad. We want to
> communicate the difference (url, hash, ret1, ret2) to UMA via an established
> channel to (Chrome? Breakpad?). How hard would that be? Can you point me
briefly
> at the yak shaving spots?

It might be possible to tunnel UMA back to the render process, but this could be
a little tricky because some validation is going to be performed before the
proxy is set up.  The communication channels may be limited, and bsy would be
your best reference on what can actually be sent when.

Alternatively, you could make sel_ldr act like a render process that accumulates
UMA stats and then dumps them directly to the browser process.  Long term I
think we need to do this, but it's going to require a lot of Chrome magic (and
also making sure we don't mess up the address space on 32-bit).  I suggest you
avoid taking this on for the sake of expedience.

But... UMA doesn't actually give you everything you want.  It's designed to
produce histograms with a finite number of buckets.  the best you can do is log
the # of times the validators disagree, but if they do disagree you'll have
problems determining why.  You want to log hash values?  There's a ugly, ugly
hack for doing that that I cannot recommend (4 256 entry histograms, look for
the biggest spikes to determine the hash value of the biggest contributor.)  You
want URLs?  No way to do that.  If you want to know more about the limitations
of UMA, we can chat about it.  It's a special purpose tool with well defined
limitations.

Assuming disagreements are rare, you probably want to create fake crash dumps. 
(See the email I just sent out to nacl-eng).  Doing that from inside the sel_ldr
process will require some yak shaving, however - no one has tried it before.  It
also won't tell you what bytes caused the problem, so either you hope the
disagreements occur on publicly accessible nexes or you figure our how to add
data to the crash dump (there are in memory structures breakpad scrapes that you
can add data to).

Powered by Google App Engine
This is Rietveld 408576698