Sitelet https://github.com/nodejs/node/issues/47889
Skip to content

libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string Abort trap: 6 #47889

Description

@Leask

Version

v20.0.0

Platform

Darwin Flora.local 22.5.0 Darwin Kernel Version 22.5.0: Tue Apr 25 04:06:50 PDT 2023; root:xnu-8796.121.2~8/RELEASE_ARM64_T6020 arm64

Subsystem

URL

What steps will reproduce the bug?

When creating a URL object with some invalid url strings, it's straightforward to reproduce:

new URL('..#', 'a:b');
libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string
Abort trap: 6

It was initially found in this use case: mozilla/readability#801

How often does it reproduce? Is there a required condition?

It can be reproduced every time on Linux and macOS as well.

What is the expected behavior? Why is that the expected behavior?

It should throw an error just like other invalid URLs.

Uncaught TypeError [ERR_INVALID_URL]: Invalid URL
    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at new NodeError (node:internal/errors:399:5)
    at new URL (node:internal/url:719:13) {
  input: 'xxxxxxx',
  code: 'ERR_INVALID_URL'
}

What do you see instead?

libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string
Abort trap: 6

Additional information

N/A

Activity

  1. himself65 commented on May 5, 2023

    @himself65
    Member

    /cc @nodejs/url

  2. added
    urlIssues and PRs related to the legacy built-in url module.
    on May 5, 2023
  3. himself65 commented on May 5, 2023

    @himself65
    Member

    I think this is the issue of Ada 2.0

  4. Leask commented on May 5, 2023

    @Leask
    Author

    I think this is the issue of Ada 2.0

    Reasonable.

  5. lemire commented on May 5, 2023

    @lemire
    Member

    Yes. It is from ada.

  6. lemire commented on May 5, 2023

    @lemire
    Member

    @anonrig Please review the potential fix.

  7. himself65 commented on May 6, 2023

    @himself65
    Member
    ➜  node git:(master) ./out/Debug/node   
    Welcome to Node.js v21.0.0-pre.
    Type ".help" for more information.
    > new url('/sitelet?url=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2F%23%27%2C%2520%27a%3Ab');
    Assert at line 5861 of file ../deps/ada/ada.h
    FAIL: validate()
    [1]    78476 abort      ./out/Debug/node
    
  8. lemire commented on May 6, 2023

    @lemire
    Member

    @himself65 Yes. We definitively had a bug in ada. I think @anonrig will push a fix.

  9. anonrig commented on May 6, 2023

    @anonrig
    Member

    Released Ada v2.3.1 with the fix to this issue thanks to @lemire

  10. Leask commented on May 8, 2023

    @Leask
    Author

    Thank you all for fixing this issue. 👏

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

    confirmed-bugIssues and PRs for confirmed bugs.urlIssues and PRs related to the legacy built-in url module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions