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

[SR-8577] Unexpected hangs when running swift-demangle on crafted strings #51095

Closed
swift-ci opened this issue Aug 18, 2018 · 2 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself mangling Area → compiler: Mangling

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8577
Radar None
Original Reporter hongxuchen (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 4.2-dev (LLVM aba011d5dc, Clang 09210590b6, Swift 6f91a4e)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Mangling
Assignee @eeckstein
Priority Medium

md5: 60977606c17b9d7ab6d17c346fdc27e5

Issue Description:

swift-demangle may hang unexpectedly on some crafted strings. For example, for a string like:

_Ttu4222222222222222222222222_rW_2T_2TJ__2D_|D__V_

It can take too long to exit (failed to exit within 30min on my machine).

The suspicious code segment should be inside swift::Demangle::archetypeName[abi:cxx11](unsigned long, unsigned long) at lib/Demangling/NodePrinter.cpp:1821 where the index can be 140737488335472.

@belkadan
Copy link
Contributor

cc @eeckstein

@eeckstein
Copy link
Member

fixed in #19152

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself mangling Area → compiler: Mangling
Projects
None yet
Development

No branches or pull requests

3 participants