Hi David,

On 2017-10-18 1:28 AM, David Teller wrote:
If I understand correctly, this triggered the usual
"undefined is not a function", which was

1/ uncaught during testing, as these things often are;

That's only because this code doesn't have any tests. That was filed as bug 1409913.

2/ basically impossible to diagnose in the wild, because there was no
error message of any kind.

There was an error message[2] which clearly pointed to the problem:
"JavaScript error: resource:///modules/CustomizableUI.jsm, line 461: TypeError: placements.spice is not a function"

I remember that we had bugs of this kind lurking for years in our
codebase, in code that was triggered daily and that everybody believed
to be tested.

I'd like to think that there is a better way to handle these bugs,
without waiting for them to explode in our user's face. Opening this
thread to see if we can find a way to somehow "solve" these bugs, either
by making them impossible, or by making them much easier to solve.

I have one proposal. Could we change the behavior of the JS VM as follows?

- The changes affect only Nightly.
- The changes affect only mozilla chrome code (including system add-ons
but not user add-ons or test code).
- Any programmer error (e.g. SyntaxError) causes a crash a crash that
displays (and attaches to the CrashReporter) both the JS stack in and
the native stack.
- Any SyntaxError is a programmer error.
- Any TypeError is a programmer error.

I expect that this will find a number of lurking errorsy, so we may want
to migrate code progressively, using a directive, say "use strict
moz-platform" and static analysis to help encourage using this directive.

What do you think?

I'm not really sure that changing the failure mode from a totally broken Firefox window to a crash really helps much. Both would have only happened once the builds were in the hands of users. The root cause of the issue was that there were no automated tests for the relevant code and from my understanding we don't need JS VM changes to address that.

I do agree with other messages in the thread about making our test harnesses stricter regarding uncaught errors but without this code being tested that wouldn't have helped here.

Cheers,
  David



[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1407351#c28

[2] https://bug1409395.bmoattachments.org/attachment.cgi?id=8919310
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to