-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Regression since 0efe111365 when building opencv with clang-cl 17.0.6 on Windows: clang-cl just hangs #69428
Comments
One of the things you can try is identifying one or more instances of clang-cl that hang, and attempt to make it crash, so it produces test case files (preprocessed .cpp and .sh). On Linux you would simply send a |
Thanks a lot @DimitryAndric for this suggestion! If you or someone knows how I can create the test case files (on Windows), I would be happy to do so! |
I observe the same issue with 17.0.4. Trying to install opencv4 via vcpkg using my clang-cl toolchain just hangs forever. |
Did anyone try with 17.0.5 yet? |
Same issue. |
@emmenlau Did you check your build logs carefully? I noticed when bisceting that there was an ICE somewhere at the start of the logs which I didn't notice at first. I don't know why ninja did not abort the build in this case and left it hanging. |
Hi @Neumann-A , Here is link: https://clang.llvm.org/docs/UsersManual.html#options-to-control-clang-crash-diagnostics From that page, I quote:
I guess with such a reproducer, the developers could help resolve the issue... |
Did anyone try clang-cl 17.0.6 yet? |
Same issue. https://github.com/backengineering/llvm-msvc doesn't seem to have the issue |
Thanks @Neumann-A ! I'll try to run the build today with |
I mean I even bisected the issue. The ICE/hang happens since 0efe111. Reverting it fixes it. |
Oh my, that is very relevant! Thanks for sharing!!! |
Dear LLVM devs, could someone kindly consider this compiler hang? It is quite relevant to build openCV, which is a rather relevant library in the image analysis community... |
Somebody still needs to provide a .sh and .cpp file from one of those hanging builds. This is essential for reproducing the problem, and attempting to fix it. |
Also, ping @phoebewang @efriedma-quic @tentzen who originated https://reviews.llvm.org/D102817 for commit 0efe111. |
I managed to configure and build opencv on Windows against Visual Studio and the official LLVM 17.0.6 package, and could intermittently reproduce the hangs: that is, some clang-cl instances hung but not consistently when you repeated the exact same command line. After retrieving the exact command line for a hanging instance, I could generate a preprocessed test case, where the hang occurs when compiling the intermediate .bc to .asm:
I transported this test case to Linux where I have more tools to do reduction, and I ended up with the following reduced test case: // clang-cl -cc1 -triple x86_64-pc-windows-msvc19.38.33134 -S -disable-llvm-verifier -fexceptions -fasync-exceptions -O2 execution_engine-min.cpp
template <bool, class _Ty1, class> using conditional_t = _Ty1;
template <class _Ty1, class _Ty2>
constexpr bool is_same_v = __is_same(_Ty1, _Ty2);
struct _Alloc_construct_ptr {
~_Alloc_construct_ptr();
};
template <class _Alnode> struct _List_node_emplace_op2 : _Alloc_construct_ptr {
_List_node_emplace_op2(_Alnode);
~_List_node_emplace_op2() { ; }
};
int _List;
struct {
template <class... _Valtys>
conditional_t<is_same_v<int, int>, int, int> emplace(_Valtys... _Vals) {
_List_node_emplace_op2(_List, _Vals...);
}
} m_executableDependencies;
void ExecutionEngineaddExecutableDependency() {
m_executableDependencies.emplace();
} This reliably produces an assertion in
This is the same error and assertion reported in #73536 and #73538. |
Intrinsics like @llvm.seh.scope.begin and @llvm.seh.scope.end which do not throw do not need funclets in catchpads or cleanuppads. Fixes #69428 Co-authored-by: Robert Cox <robert.cox@intel.com> --------- Co-authored-by: Robert Cox <robert.cox@intel.com>
Is a1f4ac7 in ClangCl 18.1.4? Because I still can not build OpenCV, it still hangs :-( :-( |
Not, it's not getting cherry-picked to 18 release. |
Thanks a lot for the feedback @phoebewang ! And there are probably strong reasons against picking it for the 18.x series, yes? It would be really great to have OpenCV build working again... :-( |
The recently released Microsoft Visual Studio 2022 17.9.10 now ships with headers that only support LLVM 17 and up, compounding the issue. Developers impacted by this issue, using clang-cl on Windows with using the latest Microsoft IDE/header, will be soon be stuck:
|
Backports to 18.1.x were stopped recently, so it'll be necessary to wait for 19. |
This specifically only impacts code built with /EHa; does OpenCV really need to be built with that flag? |
Right. The |
This does not work for me. I've replaced Did you mean to disable all exception handling? Or are there exception handling models that are expected to work? |
|
After removing |
No sure, what I know is |
I've spend some time reading up on this, and I'm under the impression that any of the This explains why removing
Can you elaborate about an independent issue? So does the current fix in clang 19 not address the issue of a compiler hang with |
I'm not expert of Clang driver. Just took a quick look, maybe you can try
I didn't see it else where. My justification is 1) |
I have reported a build issue of opencv in opencv/opencv#24390. If needed I can clone the information here. Sadly, I am unable to provide a minimal reproducer, and building opencv is slightly more involved.
It would be great if somebody could still look at this, as opencv is quite a relevant library...
The text was updated successfully, but these errors were encountered: