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-15813] Can't demangle: $s6CursesAAC0A5ErrorO7failure33_61E0A6C766720A31D17A693014794242LLXeF8functionL_SSvp #58090

Open
swift-ci opened this issue Feb 3, 2022 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software Linux Platform: Linux

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2022

Previous ID SR-15813
Radar None
Original Reporter solomonu (JIRA User)
Type Bug

Attachment: Download

Environment

Running on replit.com. I have attached a dump of the project, including source code and configuration files. You should also be able to reproduce this at https://replit.com/@solly_ucko/Swift-NCurses-copy-for-Swift-demangler-bug-report.

> swift --version
Swift version 5.4.2 (swift-5.4.2-RELEASE)
Target: x86_64-unknown-linux-gnu
> uname -a
Linux 3e5f939fdf4c 5.11.0-1029-gcp #33~20.04.3-Ubuntu SMP Tue Jan 18 12:03:29 UTC 2022 x86_64 GNU/Linux

I am new to Swift, but I have experience with languages such as Python, Rust, C, and C++, and with concepts such as linking and name mangling and demangling.

Additional Detail from JIRA
Votes 0
Component/s Compiler, swift
Labels Bug, CompilerCrash, Linux
Assignee None
Priority Medium

md5: d83118b99e4e2766330a9ce4ce109155

Issue Description:

> swift run
/home/runner/Swift-NCurses: warning: /nix/store/v8imx1nvyz0hgvx9cbcmh6gp4ngw3ffj-binutils-2.35.1/bin/ld.gold: warning: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/../lib64/Scrt1.o: unknown program property type 0xc0008002 in .note.gnu.property section
/home/runner/Swift-NCurses/Sources/Curses/Curses.swift:21:30: error: expected type
public enum CursesError: {
^
/home/runner/Swift-NCurses/Sources/Curses/Curses.swift:3:8: error: no such module 'OrderedCollections'
import OrderedCollections
^
Can't demangle: $s6CursesAAC0A5ErrorO7failure33_61E0A6C766720A31D17A693014794242LLXeF8functionL_SSvp
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend -frontend -c -primary-file /home/runner/Swift-NCurses/Sources/Curses/Curses.swift /home/runner/Swift-NCurses/Sources/Curses/Window.swift /home/runner/Swift-NCurses/Sources/Curses/WindowOwned.swift -emit-module-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses~partial.swiftmodule -emit-module-doc-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses~partial.swiftdoc -emit-module-source-info-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses~partial.swiftsourceinfo -emit-dependencies-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses.d -emit-reference-dependencies-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses.swiftdeps -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug -color-diagnostics -enable-testing -g -module-cache-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/home/runner/Swift-NCurses/Sources/ncurses/module.modulemap -parse-as-library -module-name Curses -o /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/Curses.build/Curses.swift.o -index-store-path /home/runner/Swift-NCurses/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules
1. Swift version 5.4.2 (swift-5.4.2-RELEASE)
2. While walking into decl 'Curses' (at /home/runner/Swift-NCurses/Sources/Curses/Curses.swift:5:8)
3. While evaluating request USRGenerationRequest(Curses.(file).Curses.CursesError.failure(function:returnValue:arguments:).function@/home/runner/Swift-NCurses/Sources/Curses/Curses.swift:24:22)
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x55ece04]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x55eab8e]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x55ecfe0]
/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libpthread.so.0(+0x12ef0)[0x7f506bbfbef0]
/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6(gsignal+0xca)[0x7f506b85abaa]
/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6(abort+0xff)[0x7f506b845523]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b8f322]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x18fc19d]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b7bcea]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x14e9b6c]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b7d834]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b7d371]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b7c5fc]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1b7c577]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6e84a3]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6e7ae8]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6e5aae]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6cdc12]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x192c396]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1930787]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x192c3c4]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1931496]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x192c3c4]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1931496]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x192c3c4]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x192c2e3]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x1adae29]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6cb9ff]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6e5250]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6e50f4]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6dd18b]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x6dcc43]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x4ccdb9]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x4c4c2c]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x4c099b]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x44a3c6]
/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6(__libc_start_main+0xd0)[0x7f506b846780]
/nix/store/ffiri8mgh23717kddj8lap2jz7d2n2qy-swift-5.4.2/bin/swift-frontend[0x449eca]
error: fatalError
exit status 1

@swift-ci
Copy link
Contributor Author

swift-ci commented Feb 3, 2022

Comment by Solomon Ucko (JIRA)

Based on https://github.com/apple/swift/blob/7123d2614b5f222d03b3762cb110d27a9dd98e24/docs/ABI/Mangling.rst, here is my guess for the mangled name is supposed to be parsed:

  • $s: prefix

  • 6Curses: Curses

  • AA: substitution 0, AKA Curses

  • C: class

  • 0: "identifier with word substitutions"

  • A: "last word substitution in identifier" 0

  • 5Error: Error

  • O: enum

  • 7failure: failure

  • 33_: index 32?

  • 61E0A6C766720A31D17A693014794242: 32 bytes encoded as hex?

  • LL: "file-discriminated declaration"

  • Xe: "error or unresolved type"

  • F: function

  • 8function: function

  • L_SSvp: not sure, too many possibilities depending on context

Based on the output, it seems like the original name is Curses.CursesError.failure(function:returnValue:arguments🙂, which matches with the identifiers in the mangled name.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
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 itself crash Bug: A crash, i.e., an abnormal termination of software Linux Platform: Linux
Projects
None yet
Development

No branches or pull requests

2 participants