Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Leask opened this issue May 5, 2023 · 9 comments · Fixed by #47893
Labels
confirmed-bug Issues with confirmed bugs. url Issues and PRs related to the legacy built-in url module.

Comments

@Leask
Copy link

Leask commented May 5, 2023

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

@himself65 himself65 added the confirmed-bug Issues with confirmed bugs. label May 5, 2023
@himself65
Copy link
Member

/cc @nodejs/url

@himself65 himself65 added the url Issues and PRs related to the legacy built-in url module. label May 5, 2023
@himself65
Copy link
Member

I think this is the issue of Ada 2.0

@Leask
Copy link
Author

Leask commented May 5, 2023

I think this is the issue of Ada 2.0

Reasonable.

@lemire
Copy link
Member

lemire commented May 5, 2023

Yes. It is from ada.

@lemire
Copy link
Member

lemire commented May 5, 2023

@anonrig Please review the potential fix.

@himself65
Copy link
Member

➜  node git:(master) ./out/Debug/node   
Welcome to Node.js v21.0.0-pre.
Type ".help" for more information.
> new URL('..#', 'a:b');
Assert at line 5861 of file ../deps/ada/ada.h
FAIL: validate()
[1]    78476 abort      ./out/Debug/node

@lemire
Copy link
Member

lemire commented May 6, 2023

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

@anonrig
Copy link
Member

anonrig commented May 6, 2023

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

@Leask
Copy link
Author

Leask commented May 8, 2023

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
Labels
confirmed-bug Issues with confirmed bugs. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants