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

crash: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed. #60380

Open
tayloraswift opened this issue Aug 3, 2022 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@tayloraswift
Copy link
Member

tayloraswift commented Aug 3, 2022

Describe the bug

compiling MongoKitten in release mode crashes the compiler (DEVELOPMENT-SNAPSHOT-2022-08-01-a). this is a recent regression; DEVELOPMENT-SNAPSHOT-2022-07-25-a does not crash. this only seems to affect release builds.

swift-frontend: /home/build-user/llvm-project/llvm/include/llvm/Support/Casting.h:269: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::CoroAsyncResumeInst, Y = llvm::Value]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	While splitting coroutine @"$s11MongoClient0A20SingleConnectionPoolC4next3forAA0aD0CAA0dE7RequestV_tYaKFTf4dn_n"
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x61eb4e3]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x61e922e]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x61eb86f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7f7366a9f420]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f7365f1200b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f7365ef1859]
/lib/x86_64-linux-gnu/libc.so.6(+0x22729)[0x7f7365ef1729]
/lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f7365f02fd6]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3b264ab]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3b210d1]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3aca36d]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x58f0701]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3ac061d]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x58f345b]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3ad61ad]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x58f1f63]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3ac087d]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x5f0c7e4]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3c5c106]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x3ac77ed]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x5f0c7e4]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x96428e]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x96505b]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x979615]
/home/klossy/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-01-a/usr/bin/swift-frontend[0x9793f6]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xd6de4)[0x7f73661b2de4]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609)[0x7f7366a93609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f7365fee133]

Steps To Reproduce
Steps to reproduce the behavior:

  1. clone MongoKitten @ 7.1.0
  2. compile with swift build -c release

Expected behavior

the build should succeed instead of crashing.

Environment (please fill out the following information)

  • OS: ubuntu 20.04
$ swiftenv version
DEVELOPMENT-SNAPSHOT-2022-08-01-a 
$ swift --version
Swift version 5.8-dev (LLVM 07d14852a049e40, Swift 613b3223d9ec5f6)
Target: x86_64-unknown-linux-gnu
@tayloraswift tayloraswift added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Aug 3, 2022
@CodaFi
Copy link
Contributor

CodaFi commented Aug 5, 2022

Looks like a coro splitting problem in LLVM.

CC @aschwaighofer

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.
Projects
None yet
Development

No branches or pull requests

2 participants