Skip to content

Some Test262 tests can cause a stack overflow #1307

Closed

Description

@Razican

Describe the bug
We are ignoring some Test262 tests because they cause a stack overflow in Boa. Here is the full list:

To Reproduce
You can reproduce the behaviour by running the following command, after removing them from the test_ignore.txt file:

cargo run --release --bin boa_tester -- run -s {test_path}

Expected behavior
The expected behaviour is, obviously, for them not to overflow the stack.

Activity

  1. added
    A-Bug
    C-Tests
    on Jun 7, 2021
  2. added this to the v0.13.0 milestone on Jun 7, 2021
  3. added
    Help Wanted
    on Jun 7, 2021
  4. neeldug commented on Jun 19, 2021

    @neeldug
    Contributor

    Loaded test/language/expressions/tagged-template/tco-call.js into a debugger and got an exception during eval of EXC_BAD_ACCESS(code=2, address=...), seems to occur at a memory copy of some variety, will continue stepping through to work through it.

    EDIT: The specific testcases mentioned create 7000 stack frames, compared to most testcases only having 20 stack frames.

    Also, the specific cases seem to recurse into runs and call procedures that nests to this stack frame depth, with the sequence of 3 run stack frames at mod.rs 108:23 315:37 114:27 , followed by 2 call stack frames at context.rs 320:42 and gcobject.rs 327:9, followed by a call_construct stack frame at gcobject.rs 300:30. Seems to be a recursive loop involving these calls... No idea which mod.rs it's referring to in LLDB, but any help would be appreciated.

    This could be resolved by #1323 ?

  5. Razican commented on Jun 19, 2021

    @Razican
    MemberAuthor

    I will try to give it a look in a couple of days, but something that can be tried is to see if the issue is in the parsing time or in the execution time, that would help a lot.

    You can also try to extract a minimum example, especially if the issue is when parsing, and try to get all lexed tokens, to see if they make sense, by running the "boa" binary as mentioned in "DEBUGGING.md"

  6. neeldug commented on Jun 19, 2021

    @neeldug
    Contributor

    Actually, ended up actually reading up on the feature the testcase is testing, it's tail-call optimisation, and explains why the number of stack frames is so large, i.e. this optimisation would need to be implemented on Boa's side to fix both of these from overflowing.

  7. modified the milestones: v0.13.0, v0.14.0 on Sep 25, 2021
  8. removed this from the v0.14.0 milestone on Feb 5, 2022
  9. raskad commented on May 7, 2023

    @raskad
    Member

    @HalidOdat this got fixed by #2904 right?

  10. HalidOdat commented on May 7, 2023

    @HalidOdat
    Member

    Yes, The tests no longer cause stack overflows, because a RuntimeLimit is thrown.

    So we can close this issue :)

  11. moved this from To do to Done in Boa pre-v1on May 7, 2023
  12. self-assigned this
    on May 7, 2023
  13. added this to the v0.17.0 milestone on May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-BugC-TestsHelp Wanted

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions