-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clang Crashes when template is too complex in modules. #139006
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
Comments
I was going the footage of me debugging the issue, and I found out that this problem seems to occur very randomly. At first, the definition and call site of the template is rather simple(not many symbols were exported), and it works fine. But when the definition interface unit becomes more complex, false compiler errors were reported(I am not sure if this is true since the error message is too complex and I don't know if I did anything wrong). And then I modified some of my code, and the compiler just crashes. |
@llvm/issue-subscribers-clang-modules Author: Yiran Wang (YiRanMushroom)
I don't what the actual cause of this crash is, but when I am using Google's jni-bind(which is a template metaprogramming libarary for jni) in a module, the compiler crashes. Please note that where the template is defined does not matter(in a header file or a module). It would crash on the call site(place where instantiation occurs). Here is the console output, I will provide more information after this.
The lines indicates the cause of crash:
```
1. <eof> parser at end of file
2. E:\code\C++\EasyEngineDevDir\EasyEditor\src\EditorMain.ixx:69:12: LLVM IR generation of declaration 'main'
3. E:\code\C++\EasyEngineDevDir\EasyEditor\src\EditorMain.ixx:69:12: Generating code for declaration 'main'
4. E:\code\C++\EasyEngineDevDir\EasyEditor\EasyEngineCore\vendor\jni-bind\jni_bind_release.h:6722:18: Mangling declaration 'jni::metaprogramming::InvocableMap20<jni::StaticRef<ETLib>, jni::JniT<_jobject *, ETLib, jni::kDefaultClassLoader, jni::kDefaultJvm>::static_v, jni::StaticRefHelper<jni::StaticRef<ETLib>, ETLib, jni::kDefaultClassLoader, jni::kDefaultJvm>, const std::tuple<jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<_jstring *>>>, jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, _jstring *, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>> jni::Static<std::tuple<jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<_jstring *>>>, jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, _jstring *, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>>, std::tuple<>>::*, &jni::Static<std::tuple<jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<_jstring *>>>, jni::Method<std::tuple<jni::Return<void>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, _jstring *, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>, jni::Method<std::tuple<jni::Return<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>, std::tuple<jni::Params<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>, jni::Array<jni::Class<std::tuple<jni::Extends<jni::RootObject>>, std::tuple<jni::Constructor<>>, std::tuple<jni::Static<std::tuple<>, std::tuple<>>>, std::tuple<>, std::tuple<>>>>>>>, std::tuple<>>::methods_>::Call'
```
The full Log is:
The two files are: The relevant repository is https://github.com/google/jni-bind |
If you want, you can build clang yourself in debug version with assertion enabled, it can provide much more information. |
I don't what the actual cause of this crash is, but when I am using Google's jni-bind(which is a template metaprogramming libarary for jni) in a module, the compiler crashes. Please note that where the template is defined does not matter(in a header file or a module). It would crash on the call site(place where instantiation occurs). Here is the console output, I will provide more information after this.
The lines indicates the cause of crash:
The full Log is:
The two files are:
EditorMain-4a63f4.cppm.txt
EditorMain-4a63f4.sh.txt
The relevant repository is https://github.com/google/jni-bind
My project repository: https://github.com/YiRanMushroom/EasyEditor
The STL I am using is MSVC STL. STL module is build by myself.
The text was updated successfully, but these errors were encountered: