Граф коммитов

579485 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote a9860dbcb8 Bug 1423840 - Temporarily disable a small part of the prefs parser gtest due to failures on Windows. r=me 2018-02-01 19:14:30 +11:00
Nicholas Nethercote eeb14c6c69 Bug 1423840 (attempt 2) - Rewrite the prefs parser. r=glandium,Manishearth
The prefs parser has two significant problems.

- It doesn't separate tokenizing from parsing.

- It is implemented as a loop around a big switch on a "current state"
  variable.

As a result, it is hard to understand and modify, slower than it could be, and
in obscure cases (involving comments and whitespace) it fails to parse what
should be valid input.

This patch replaces it with a recursive descent parser (albeit one without any
recursion!) that has separate tokenization. The new parser is easier to
understand and modify, more correct, and has better error messages. It doesn't
do error recovery, but that would be much easier to add than in the old parser.

The new parser also runs about 1.9x faster than the existing parser. (As
measured by parsing greprefs.js's contents from memory 1000 times in
succession, omitting the prefs hash table construction. If the table
construction is included, it's about 1.6x faster.)

The new parser is slightly stricter than the old parser in a few ways.

- Disconcertingly, the old parser allowed arbitrary junk between prefs
  (including at the start and end of the prefs file) so long as that junk
  didn't include any of the following chars: '/', '#', 'u', 's', 'p'. I.e.
  lines like these:

    !foo@bar&pref("prefname", true);
    ticky_pref("prefname", true);       // missing 's' at start
    User_pref("prefname", true);        // should be 'u' at start

  would all be treated the same as this:

    pref("prefname", true);

  The new parser disallows such junk because it isn't necessary and seems like
  an unintentional botch by the old parser.

- The old parser allowed character 0x1a (SUB) between tokens and treated it
  like '\n'.

  The new parser does not allow this character. SUB was used to indicate
  end-of-file (*not* end-of-line) in some old operating systems such as MS-DOS,
  but this doesn't seem necessary today.

- The old parser tolerated (with a warning) invalid escape sequences within
  string literals -- such as "\q" (not a valid escape) and "\x1" and "\u12"
  (both of which have insufficient hex digits) -- accepting them literally.

  The new parser does not tolerate invalid escape sequences because it doesn't
  seem necessary and would complicate things.

- The old parser tolerated character 0x00 (NUL) within string literals; this is
  dangerous because C++ code that manipulates string values with embedded NULs
  will almost certainly consider those chars as end-of-string markers.

  The new parser treats NUL chars as end-of-file, to avoid this danger and
  because it facilitates a significant optimization (described within the
  code).

- The old parser allowed integer literals to overflow, silently wrapping them.

  The new parser treats integer overflow as a parse error. This seems better,
  and it caught existing overflows of places.database.lastMaintenance, in
  testing/profiles/prefs_general.js (bug 1424030) and
  testing/talos/talos/config.py (bug 1434813).

The first of these changes meant that a couple of existing prefs with ";;" at
the end had to be changed (done in the preceding patch).

The minor increase in strictness shouldn't be a problem for default pref files
such as greprefs.js within the application (which we can modify), nor for
app-written prefs files such as prefs.js. It could affect user-written prefs
files such as user.js; the experience above suggests that integer overflow and
";;" are the most likely problems in practice. In my opinion, the risk here is
acceptable.

The new parser also does a better job of tracking line numbers because it (a)
treats "\r\n" sequences as a single end-of-line marker, and (a) pays attention
to end-of-line sequences within string literals.

Finally, the patch adds thorough tests of both valid and invalid syntax.

MozReview-Commit-ID: JD3beOQl4AJ
2018-02-01 16:21:47 +11:00
Nicholas Nethercote 88664febda Bug 1423840 (attempt 2) - Remove extraneous semicolons in all.js. r=glandium
MozReview-Commit-ID: 2BMfVOoEtQ2
2018-02-01 15:44:29 +11:00
Nicholas Nethercote 7b9969bae5 Bug 1434813 - Fix integer overflow of places.database.lastMaintenance in testing/profiles/prefs_general.js. r=glandium.
Bug 1383896 added this constant to testing/talos/talos/config.py:

> FAR_IN_FUTURE = 7258114800

which is used as the value for the "places.database.lastMaintenance" pref.
(7258114800 seconds after 1970 is the start of the year 2200.)

 libpref stores integers prefs as int32_t and the current parser doesn't detect
overflow. So this overflows to -1331819792. (I detected this with the new prefs
parser from bug 1423840, which does detect integer overflow.) As a result the
condition testing this pref in
toolkit/components/places/PlacesCategoriesStarter.js ends up always succeeding
in tests, which is the exact opposite of what was intended. This patch changes
it to 2147483647 (the year 2038), the maximum int32_t value.

(Note: this is much the same as bug 1424030, which was fixed recently.)

MozReview-Commit-ID: AQw4b8tmE9u
2018-02-01 15:40:32 +11:00
Liam Hodgins 19eedbc5e6 Bug 1403334 - Make sure the property value overflow is indented. r=gl 2018-01-31 22:50:51 -05:00
Chris Pearce b37bd17a56 Bug 1433344 - Convert encrypted AAC to ADTS before decryption. r=jya
MozReview-Commit-ID: IGmBfJtYsCi

--HG--
extra : rebase_source : d066644e848f8fb379607d0168960132881d7df8
2018-01-30 14:39:09 +13:00
Cosmin Sabou 97ef7010af Backed out 7 changesets (bug 1434429) for build bustages on regress-618572.js and TokenStream.h on a CLOSED TREE
Backed out changeset 1e0faca62e86 (bug 1434429)
Backed out changeset b190c5a3dab2 (bug 1434429)
Backed out changeset 95e07a79f4b2 (bug 1434429)
Backed out changeset 21c79fd76133 (bug 1434429)
Backed out changeset 45c9102825ab (bug 1434429)
Backed out changeset 112eaf00632c (bug 1434429)
Backed out changeset 024f70aeba70 (bug 1434429)
2018-02-01 03:31:45 +02:00
Cosmin Sabou b35f58da34 Backed out changeset 1fea6030657b (bug 1433344) for mda failures on EMEDecoderModule.cpp on a CLOSED TREE 2018-02-01 03:05:53 +02:00
Cosmin Sabou 9efa17a39e Backed out 2 changesets (bug 1423840) for mass Talos failures due to forbidden connections. CLOSED TREE
Backed out changeset e8b798a5205a (bug 1423840)
Backed out changeset e500592d3551 (bug 1423840)
2018-02-01 03:05:08 +02:00
Jeff Walden 97ce3ebeb2 Bug 1434429 - Comment out an assertion whose condition is disliked by certain versions of gcc for entirely mysterious reasons, to be debugged later. r=bustage in a still-CLOSED TREE 2018-01-31 16:53:44 -08:00
Jeff Walden cc18bb0ca7 Bug 1434429 - Followup bustage fix (?) for gcc (and maybe other?) compiler bustage. Worked in recent clang... r=boogstage in a CLOSED TREE 2018-01-31 16:22:24 -08:00
Jeff Walden b3ac36a8a8 Bug 1434429 - Implement TokenStreamChars::matchMultiUnitCodePoint as a better nailing-down of behavior when processing a multi-code unit code point. r=arai
--HG--
extra : rebase_source : a3de66ce2abb1b5399b725961e67771ef374a58d
2018-01-18 11:34:27 -08:00
Jeff Walden fb577bbcc0 Bug 1434429 - Implement a TokenStreamChars::ungetCodePointIgnoreEOL and use it to report errors at precise locations, rather than blindly at the beginning of the token (which happens to be the same thing, just not nearly as clear about it). r=arai
--HG--
extra : rebase_source : 2402cd48df9d1a554756b1242a706d103f519901
2018-01-18 11:34:27 -08:00
Jeff Walden 806b664104 Bug 1434429 - Move TokenStreamSpecific::ungetCharIgnoreEOL into TokenStreamCharsBase. r=arai
--HG--
extra : rebase_source : 15c6b209b8a8509ed957f6b74ee0139714ecb68a
2018-01-18 11:34:27 -08:00
Jeff Walden de083b3ca7 Bug 1434429 - Move TokenStreamSpecific::ungetChar into a new GeneralTokenStreamChars<CharT, AnyCharsAccess> inserted between TokenStreamCharsBase<CharT> and TokenStreamChars<CharT, AnyCharsAccess> in the token stream inheritance hierarchy. r=arai
--HG--
extra : rebase_source : a5ed08ccd92c29476b1219f5966aa3d63de539d2
2018-01-18 11:34:27 -08:00
Jeff Walden 9771f077e9 Bug 1434429 - Use MakeScopeExit to handle resetting userbuf offset in TokenStreamSpecific::putIdentInTokenbuf. r=arai
--HG--
extra : rebase_source : 16e63b41fc4ed043ea6328aad03596f2344f8e36
2018-01-29 12:08:05 -08:00
David Parks 1dd54ad783 Bug 1433856 - Block PluginModuleChromeParent::CleanupFromTimeout from recursing. r=jimm
CleanupFromTimeout is (transitively) recursing in calls to Close(), as that now leads to shutting down the plugin broker thread and CleanupFromTimeout was being rerun since nsThread::Shutdown runs tasks..
2018-01-29 18:15:18 -08:00
David Parks c6dc5f3406 Bug 1433855 - Make sure plugin function broker's PostToDispatchThread is Waiting before Notifying it. r=jimm
The Monitor's condition variable could be notified before the calling thread had begun to Wait for it.  This caused the Notify to be missed, leading to hangs.  By grabbing the Monitor in PostToDispatchHelper, we know Wait has been called because, otherwise, the calling thread would still hold the Monitor.
2018-01-30 17:32:27 -08:00
Nicholas Nethercote 67e80b725b Bug 1423840 - Rewrite the prefs parser. r=glandium,Manishearth
The prefs parser has two significant problems.

- It doesn't separate tokenizing from parsing.

- It is implemented as a loop around a big switch on a "current state"
  variable.

As a result, it is hard to understand and modify, slower than it could be, and
in obscure cases (involving comments and whitespace) it fails to parse what
should be valid input.

This patch replaces it with a recursive descent parser (albeit one without any
recursion!) that has separate tokenization. The new parser is easier to
understand and modify, more correct, and has better error messages. It doesn't
do error recovery, but that would be much easier to add than in the old parser.

The new parser also runs about 1.9x faster than the existing parser. (As
measured by parsing greprefs.js's contents from memory 1000 times in
succession, omitting the prefs hash table construction. If the table
construction is included, it's about 1.6x faster.)

The new parser is slightly stricter than the old parser in a few ways.

- Disconcertingly, the old parser allowed arbitrary junk between prefs
  (including at the start and end of the prefs file) so long as that junk
  didn't include any of the following chars: '/', '#', 'u', 's', 'p'. I.e.
  lines like these:

    !foo@bar&pref("prefname", true);
    ticky_pref("prefname", true);       // missing 's' at start
    User_pref("prefname", true);        // should be 'u' at start

  would all be treated the same as this:

    pref("prefname", true);

  The new parser disallows such junk because it isn't necessary and seems like
  an unintentional botch by the old parser.

- The old parser allowed character 0x1a (SUB) between tokens and treated it
  like '\n'.

  The new parser does not allow this character. SUB was used to indicate
  end-of-file (*not* end-of-line) in some old operating systems such as MS-DOS,
  but this doesn't seem necessary today.

- The old parser tolerated (with a warning) invalid escape sequences within
  string literals -- such as "\q" (not a valid escape) and "\x1" and "\u12"
  (both of which have insufficient hex digits) -- accepting them literally.

  The new parser does not tolerate invalid escape sequences because it doesn't
  seem necessary and would complicate things.

- The old parser tolerated character 0x00 (NUL) within string literals; this is
  dangerous because C++ code that manipulates string values with embedded NULs
  will almost certainly consider those chars as end-of-string markers.

  The new parser treats NUL chars as end-of-file, to avoid this danger and
  because it facilitates a significant optimization (described within the
  code).

- The old parser allowed integer literals to overflow, silently wrapping them.

  The new parser treats integer overflow as a parse error. This seems better,
  and it caught an existing overflow in testing/profiles/prefs_general.js, for
  places.database.lastMaintenance (see bug 1424030).

The first of these changes meant that a couple of existing prefs with ";;" at
the end had to be changed (done in the preceding patch).

The minor increase in strictness shouldn't be a problem for default pref files
such as greprefs.js within the application (which we can modify), nor for
app-written prefs files such as prefs.js. It could affect user-written prefs
files such as user.js; the experience above suggests that ";;" is the most
likely problem in practice. In my opinion, the risk here is acceptable.

The new parser also does a better job of tracking line numbers because it (a)
treats "\r\n" sequences as a single end-of-line marker, and (a) pays attention
to end-of-line sequences within string literals.

Finally, the patch adds thorough tests of both valid and invalid syntax.

MozReview-Commit-ID: 8EYWH7KxGG
* * *
[mq]: win-fix

MozReview-Commit-ID: 91Bxjfghqfw

--HG--
extra : rebase_source : a8773413e5d68c33e4329df6819b6e1f82c22b85
2017-12-03 00:26:36 +11:00
Nicholas Nethercote 7d28c00d31 Bug 1423840 - Remove extraneous semicolons in all.js. r=glandium
The new prefs parser won't allow them.

MozReview-Commit-ID: 90EFcx0sbdf

--HG--
extra : rebase_source : 4fb9eade53fbf9eb04fe6c68f94454371cea0e6f
2017-12-08 15:15:20 +11:00
shindli 8bf605352e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-02-01 00:38:55 +02:00
shindli a9ac1e44cc Merge inbound to mozilla-central. a=merge 2018-02-01 00:32:39 +02:00
shindli 91bc2053a8 Merge autoland to mozilla-central. a=merge 2018-02-01 00:30:10 +02:00
Felipe Gomes cf0ca23dac Bug 1434164 - Use ChromeUtils.defineModuleGetter. r=me ON A CLOSED TREE
MozReview-Commit-ID: GJ5UomDMgvU
2018-01-31 19:44:21 -02:00
Nathan Froyd 87e87fc09b Bug 1434659 - move --enable-oom-breakpoint to moz.configure; r=nalexander 2018-01-31 14:35:57 -05:00
ffxbld 03673b57d5 No bug, Automated HPKP preload list update from host bld-linux64-spot-302 - a=hpkp-update 2018-01-31 11:29:14 -08:00
ffxbld d07a5ef4b0 No bug, Automated HSTS preload list update from host bld-linux64-spot-302 - a=hsts-update 2018-01-31 11:29:10 -08:00
Andreas Pehrson 0d112b8fad Bug 1434628 - Unbust --disable-webrtc builds. r=padenot, a=me
MozReview-Commit-ID: Ef8LOr1YymV
2018-01-31 16:59:53 +01:00
Andreea Pavel f41017f5cd Merge inbound to mozilla-central. a=merge 2018-01-31 19:38:21 +02:00
Andreas Pehrson f3cc4b74af Bug 1299515 - Fix bustage on a CLOSED TREE. r=me
--HG--
extra : rebase_source : 5312eaeec727b4cc9ced77fc2adbbff19ab6cc26
extra : histedit_source : c6638f1b1df9af06b30412e774c4a6f782d45c8c
2018-01-31 16:08:13 +01:00
Bogdan Tara 5c052cc871 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-01-31 12:10:31 +02:00
Bogdan Tara 1a6614b8b5 Merge inbound to mozilla-central. a=merge 2018-01-31 12:00:14 +02:00
Bogdan Tara b56a0f8804 Merge autoland to mozilla-central. a=merge 2018-01-31 11:58:23 +02:00
Julian Descottes ebc768d323 Bug 1403902 - migrate browser_webconsole_bug_580454_timestamp_l10n to xpcshell test;r=nchevobbe
MozReview-Commit-ID: 6uMMrzMSJB6

--HG--
rename : devtools/client/webconsole/test/browser_webconsole_bug_580454_timestamp_l10n.js => devtools/client/webconsole/new-console-output/test/unit/test_webconsole_l10n.js
extra : rebase_source : d299dc9973edea6ce1fc3899b3c8a1cc13bf47f3
2018-01-31 08:56:21 +01:00
Andreea Pavel 2ebbd41c08 Backed out 8 changesets (bug 633062) for failing xpcshell on Windows at services/sync/tests/unit/test_hmac_error.js on a CLOSED TREE
Backed out changeset b4e9cd0d61ab (bug 633062)
Backed out changeset ee294cebe485 (bug 633062)
Backed out changeset 3d1ad6b3bbee (bug 633062)
Backed out changeset c053f43da9e8 (bug 633062)
Backed out changeset 549e1282ae8e (bug 633062)
Backed out changeset 35058a83dab0 (bug 633062)
Backed out changeset 2e9dc98eabf0 (bug 633062)
Backed out changeset dbbacd08392c (bug 633062)
2018-01-31 10:07:34 +02:00
Dorel Luca 9f8b519dae Backed out 8 changesets (bug 633062) for xpcshell failures on browser/extensions/formautofill/test/unit/test_sync.js on a CLOSED TREE
Backed out changeset d60ca66f2b62 (bug 633062)
Backed out changeset d80494d5bc36 (bug 633062)
Backed out changeset 33f832b59e86 (bug 633062)
Backed out changeset 968db19986aa (bug 633062)
Backed out changeset a55a3647ea49 (bug 633062)
Backed out changeset bb1030bdab48 (bug 633062)
Backed out changeset 9c4cd2a6965c (bug 633062)
Backed out changeset 669c76bd2618 (bug 633062)

--HG--
extra : amend_source : cf95d15507de46de393cdef797a5808c4e0407ff
2018-01-31 07:28:06 +02:00
Dzmitry Malyshau 04332d008f Bug 1434410: Move the WebRender revision to a separate file and include it in captures. r=kats
MozReview-Commit-ID: 9ZgALwny1p2
2018-01-30 23:24:55 -05:00
ffxbld 31a384019d No bug, Automated blocklist update from host bld-linux64-spot-324 - a=blocklist-update 2018-01-30 18:26:20 -08:00
ffxbld 90a41c3b7d No bug, Automated HPKP preload list update from host bld-linux64-spot-324 - a=hpkp-update 2018-01-30 18:26:16 -08:00
ffxbld a75c2f5111 No bug, Automated HSTS preload list update from host bld-linux64-spot-324 - a=hsts-update 2018-01-30 18:26:13 -08:00
Coroiu Cristina 4854a65d8c Backed out 3 changesets (bug 1368699) for bustage on Android L10n nightlies a=backout
Backed out changeset e16fc8abd345 (bug 1368699)
Backed out changeset 35a5db01b6ae (bug 1368699)
Backed out changeset 7297a1e8c4ff (bug 1368699)
2018-01-31 01:59:23 +02:00
Nicholas Nethercote 5c975c03b1 Bug 1433982 - Make nsAtomicFileOutputStream::DoOpen() fail if the file is read-only. r=glandium
This means we don't leave behind prefs-<n>.js files when prefs.js is read-only.

MozReview-Commit-ID: H6KKnoYGdhH

--HG--
extra : rebase_source : 263dd6fb75204a4565c8af89e7b21fc37a10d52e
2018-01-31 10:01:26 +11:00
Sebastian Hengst 732cb1d98b merge mozilla-inbound to mozilla-central. r=merge a=merge 2018-01-31 00:22:27 +02:00
Mark Banner 9a2172526a Bug 1434449 - Enable no-unused-vars for the global (as well as local) scope on jsm files, whitelist directories still to be fixed. r=florian.
MozReview-Commit-ID: 3vBWDR3UjGF

--HG--
extra : rebase_source : 61495d14a8d761e71b4072b02e2ca57e77f44059
2018-01-30 22:10:08 +00:00
Mark Banner b9f306bb12 Bug 1434449 - Removed some unused code in jsm files in browser/base and browser/modules. r=florian
MozReview-Commit-ID: 9VhKxnpdzCD

--HG--
extra : rebase_source : ecc1f9196a5fb22cf78c51ead89f84e154c5198f
2018-01-30 22:09:02 +00:00
Tom Prince d8968f156b Bug 1434365: Remove unused by-platform option for L10N config-paths; r=Callek
Differential Revision: https://phabricator.services.mozilla.com/D513

--HG--
extra : rebase_source : 3c4345c3442f74d4f86fc2d801c251d93f8b6045
2018-01-30 11:51:23 -07:00
Tom Prince 6b745cb132 Bug 1434365: Add support for specifying mozharness config paths and checking out comm-central to repackage tasks; r=aki
Differential Revision: https://phabricator.services.mozilla.com/D512

--HG--
extra : rebase_source : dc165357115f51475279f90679b89c14ec1c6038
2018-01-30 11:50:57 -07:00
Tom Prince 521c194c6c Bug 1434365: Move repackage mozharness config selection to yaml; r=aki
Differential Revision: https://phabricator.services.mozilla.com/D511

--HG--
extra : rebase_source : 69e82fe6623609412ee6150a32ea0001b07d5c30
2018-01-30 11:44:30 -07:00
Chris Pearce 328670db16 Bug 1433344 - Convert encrypted AAC to ADTS before decryption. r=jya
MozReview-Commit-ID: IGmBfJtYsCi

--HG--
extra : rebase_source : a0752ed6c85faf4333ae84a3e5b20695b5bf26a6
2018-01-30 14:39:09 +13:00
Joel Maher 79250dba5d Bug 1434715 - remove reftest-no-accel from windows10. r=ahal 2018-01-31 16:14:43 -05:00