Skip to content

Test262 panics #817

Closed
Closed

Description

@Razican

This is a full list of panics the current ECMAScript test suite (test262) gives, 13-14 in total. We should aim for 0 panics (even before we try to implement the rest of the spec):

  • Object already borrowed: BorrowMutError (#1059), count: 2 Example:
    thread 'main' panicked at 'Object already borrowed: BorrowMutError', boa/src/object/internal_methods.rs:198:18
  • Identifier arguments has already been declared (#1062), count: 8 Example:
    thread 'main' panicked at 'Identifier arguments has already been declared', boa/src/environment/declarative_environment_record.rs:52:13
  • range start index 2 out of range for slice of length 0 (#1241), count: 2 Example:
    thread 'main' panicked at 'range start index 2 out of range for slice of length 0', boa/src/builtins/function/mod.rs:123:45
  • Could not get slice (#1242), count: 1 Example:
    thread 'main' panicked at 'Could not get slice', boa/src/builtins/regexp/mod.rs:413:56

There is another random panic that seems to not always occur, so we don't have too much information about it, or the exact test where it happens (there are multiple tests with that name):

thread 'main' panicked at 'Object already mutably borrowed: BorrowError', boa/src/value/type.rs:50:27
last panic was on test "returns-iterator"

It seems to happen here when calling the get_type() function in an object, when checking if the object is a function. This happens if the object is already mutably borrowed, and this borrow will fail. Interestingly, this doesn't happen in every run.

How to replicate / find code to reproduce:

If you run the test262 suite, you will be able to see for each of the panics which one was the panicking test. To run it:

cargo run --release --bin boa_tester -- run -v 2>error.log

This will put all panics and errors in the error.log file. For each panic, you will see something like this:

thread 'main' panicked at 'Could not get slice', boa/src/builtins/regexp/mod.rs:413:56
last panic was on test "failure-g-lastindex-reset"

This means that the panic was on that test file. You can search for that test file here: https://github.com/tc39/test262/find/main

Activity

  1. added
    A-Bug
    Good First Issue
    Hacktoberfest
    on Oct 8, 2020
  2. added this to the v0.11.0 milestone on Oct 8, 2020
  3. Razican commented on Oct 21, 2020

    @Razican
    MemberAuthor

    Updated the list of panics, counting those that are still present even after #906 gets merged.

    The two main areas I see for concern are the Array implementation, whose methods seem not to be spec compliant and seems to use too many expects or unwraps, and the RegExp implementation.

    Then, we should re-check the list and make sure that all the environment related panics get solved in #659.

  4. Razican commented on Jan 1, 2021

    @Razican
    MemberAuthor

    I have updated the list of panics after the merges of the latest changes. It seems that our current "big thing" is RegExp, along with a couple of places in environment variable definitions and retrievals.

  5. modified the milestones: v0.11.0, v0.12.0 on Jan 11, 2021
  6. Razican commented on Jan 12, 2021

    @Razican
    MemberAuthor

    I have updated the list of panics. We now have one issue per panic (except for the one that happens randomly). This should help tackle the remaining Test262 panics on the Boa 0.12 release, and make it much safer to use in other projects.

  7. modified the milestones: v0.12.0, v0.13.0 on May 22, 2021
  8. linked a pull request that will close this issueFix environment record panics #1285on May 27, 2021
  9. modified the milestones: v0.13.0, v0.12.0 on May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BugGood First IssueHacktoberfest

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions