Skip to content

[Orc] Fix error handling in ORCPlatformSupport::initialize #144637

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

Merged
merged 5 commits into from
Jul 7, 2025

Conversation

SahilPatidar
Copy link
Contributor

Previously, result was checked before handling the Error returned by callSPSWrapper. If Error was success but result indicated failure, the original Error was silently dropped, triggering an assertion failure for unhandled Error.

This patch ensures the Error is checked and returned before inspecting result, preventing assertion failures.

@SahilPatidar SahilPatidar marked this pull request as ready for review June 18, 2025 05:56
@SahilPatidar SahilPatidar requested a review from lhames June 18, 2025 05:57
Copy link
Contributor

@lhames lhames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @SahilPatidar!

Copy link
Member

@anutosh491 anutosh491 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Thanks @kr-2003 for reporting this and @SahilPatidar for the fix.

@kr-2003
Copy link
Contributor

kr-2003 commented Jun 30, 2025

These are the tests failing in the CI(for windows). Are these related to the changes??

2025-06-30T06:37:53.1983603Z Failed Tests (2):
2025-06-30T06:37:53.1983802Z   LLVM :: DebugInfo/COFF/local-variable-gap.ll
2025-06-30T06:37:53.1984156Z   LLVM :: MC/COFF/cv-def-range-gap.s

LLVM :: DebugInfo/COFF/local-variable-gap.ll

2025-06-30T06:34:53.3858849Z FAIL: LLVM :: DebugInfo/COFF/local-variable-gap.ll (29843 of 59269)
2025-06-30T06:34:53.3894212Z ******************** TEST 'LLVM :: DebugInfo/COFF/local-variable-gap.ll' FAILED ********************
2025-06-30T06:34:53.3894878Z Exit Code: 2
2025-06-30T06:34:53.3908504Z 
2025-06-30T06:34:53.3914663Z Command Output (stdout):
2025-06-30T06:34:53.3923167Z --
2025-06-30T06:34:53.3924249Z # RUN: at line 1
2025-06-30T06:34:53.3927792Z c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=x86_64-windows-msvc < C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll --check-prefix=ASM
2025-06-30T06:34:53.3930574Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=x86_64-windows-msvc
2025-06-30T06:34:53.3931634Z # note: command had no output on stdout or stderr
2025-06-30T06:34:53.3933049Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll' --check-prefix=ASM
2025-06-30T06:34:53.3934461Z # note: command had no output on stdout or stderr
2025-06-30T06:34:53.3934945Z # RUN: at line 2
2025-06-30T06:34:53.3937750Z c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=x86_64-windows-msvc < C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll -filetype=obj | c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe --codeview - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll --check-prefix=OBJ
2025-06-30T06:34:53.3942446Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=x86_64-windows-msvc -filetype=obj
2025-06-30T06:34:53.3943257Z # .---command stderr------------
2025-06-30T06:34:53.3944023Z # | Assertion failed: Symbol, file C:\_work\llvm-project\llvm-project\llvm\lib\MC\MCExpr.cpp, line 223
2025-06-30T06:34:53.3945820Z # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
2025-06-30T06:34:53.3946575Z # | Stack dump:
2025-06-30T06:34:53.3947237Z # | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\llc.exe -mtriple=x86_64-windows-msvc -filetype=obj
2025-06-30T06:34:53.3948051Z # | Exception Code: 0x80000003
2025-06-30T06:34:53.3948622Z # |  #0 0x00007ff60b117485 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x2e07485)
2025-06-30T06:34:53.3949473Z # |  #1 0x00007fff3764d88d (C:\Windows\System32\ucrtbase.dll+0x6d88d)
2025-06-30T06:34:53.3950084Z # |  #2 0x00007fff3764e761 (C:\Windows\System32\ucrtbase.dll+0x6e761)
2025-06-30T06:34:53.3950738Z # |  #3 0x00007fff376500c1 (C:\Windows\System32\ucrtbase.dll+0x700c1)
2025-06-30T06:34:53.3952272Z # |  #4 0x00007fff376503f1 (C:\Windows\System32\ucrtbase.dll+0x703f1)
2025-06-30T06:34:53.3953110Z # |  #5 0x00007ff60a92768e (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x261768e)
2025-06-30T06:34:53.3954308Z # |  #6 0x00007ff60a987b94 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x2677b94)
2025-06-30T06:34:53.3956667Z # |  #7 0x00007ff60a988a4f (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x2678a4f)
2025-06-30T06:34:53.3973076Z # |  #8 0x00007ff60a95bbff (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x264bbff)
2025-06-30T06:34:53.3974388Z # |  #9 0x00007ff60a95af7f (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x264af7f)
2025-06-30T06:34:53.3975740Z # | #10 0x00007ff60a9595de (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x26495de)
2025-06-30T06:34:53.3976957Z # | #11 0x00007ff60a1a09e0 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x1e909e0)
2025-06-30T06:34:53.3977812Z # | #12 0x00007ff60a74db7a (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x243db7a)
2025-06-30T06:34:53.3978664Z # | #13 0x00007ff60a7534f7 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x24434f7)
2025-06-30T06:34:53.3980605Z # | #14 0x00007ff60a752ad7 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x2442ad7)
2025-06-30T06:34:53.3981628Z # | #15 0x00007ff6083fe953 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0xee953)
2025-06-30T06:34:53.3982555Z # | #16 0x00007ff6084019df (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0xf19df)
2025-06-30T06:34:53.3983445Z # | #17 0x00007ff60bcf4410 (c:\_work\llvm-project\llvm-project\build\bin\llc.exe+0x39e4410)
2025-06-30T06:34:53.3984179Z # | #18 0x00007fff38c47ac4 (C:\Windows\System32\KERNEL32.DLL+0x17ac4)
2025-06-30T06:34:53.3984810Z # | #19 0x00007fff47f6a8c1 (C:\Windows\SYSTEM32\ntdll.dll+0x5a8c1)
2025-06-30T06:34:53.3985321Z # `-----------------------------
2025-06-30T06:34:53.3985728Z # error: command failed with exit status: 0x80000003
2025-06-30T06:34:53.3986458Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe' --codeview -
2025-06-30T06:34:53.3987162Z # .---command stderr------------
2025-06-30T06:34:53.3987992Z # | c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe: error: '<stdin>': The file was not recognized as a valid object file
2025-06-30T06:34:53.3988847Z # `-----------------------------
2025-06-30T06:34:53.3989274Z # error: command failed with exit status: 1
2025-06-30T06:34:53.3992288Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll' --check-prefix=OBJ
2025-06-30T06:34:53.3994904Z # .---command stderr------------
2025-06-30T06:34:53.4004464Z # | FileCheck error: '<stdin>' is empty.
2025-06-30T06:34:53.4007185Z # | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\DebugInfo\COFF\local-variable-gap.ll --check-prefix=OBJ
2025-06-30T06:34:53.4008432Z # `-----------------------------
2025-06-30T06:34:53.4008823Z # error: command failed with exit status: 2
2025-06-30T06:34:53.4009129Z 
2025-06-30T06:34:53.4009241Z --
2025-06-30T06:34:53.4009379Z 

LLVM :: MC/COFF/cv-def-range-gap.s

2025-06-30T06:35:28.2865792Z FAIL: LLVM :: MC/COFF/cv-def-range-gap.s (36434 of 59269)
2025-06-30T06:35:28.2866616Z ******************** TEST 'LLVM :: MC/COFF/cv-def-range-gap.s' FAILED ********************
2025-06-30T06:35:28.2867606Z Exit Code: 2
2025-06-30T06:35:28.2867805Z 
2025-06-30T06:35:28.2867956Z Command Output (stdout):
2025-06-30T06:35:28.2868269Z --
2025-06-30T06:35:28.2868464Z # RUN: at line 1
2025-06-30T06:35:28.2870918Z c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe -triple=x86_64-pc-win32 -filetype=obj < C:\_work\llvm-project\llvm-project\llvm\test\MC\COFF\cv-def-range-gap.s | c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe --codeview - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\MC\COFF\cv-def-range-gap.s
2025-06-30T06:35:28.2873765Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe' -triple=x86_64-pc-win32 -filetype=obj
2025-06-30T06:35:28.2874604Z # .---command stderr------------
2025-06-30T06:35:28.2875553Z # | Assertion failed: Success && "failed to evaluate label difference as absolute", file C:\_work\llvm-project\llvm-project\llvm\lib\MC\MCCodeView.cpp, line 467
2025-06-30T06:35:28.2877408Z # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
2025-06-30T06:35:28.2878329Z # | Stack dump:
2025-06-30T06:35:28.2880357Z # | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\llvm-mc.exe -triple=x86_64-pc-win32 -filetype=obj
2025-06-30T06:35:28.2881407Z # | Exception Code: 0x80000003
2025-06-30T06:35:28.2882100Z # |  #0 0x00007ff633f46645 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0xa16645)
2025-06-30T06:35:28.2883154Z # |  #1 0x00007fff3764d88d (C:\Windows\System32\ucrtbase.dll+0x6d88d)
2025-06-30T06:35:28.2883899Z # |  #2 0x00007fff3764e761 (C:\Windows\System32\ucrtbase.dll+0x6e761)
2025-06-30T06:35:28.2884593Z # |  #3 0x00007fff376500c1 (C:\Windows\System32\ucrtbase.dll+0x700c1)
2025-06-30T06:35:28.2885223Z # |  #4 0x00007fff376503f1 (C:\Windows\System32\ucrtbase.dll+0x703f1)
2025-06-30T06:35:28.2886027Z # |  #5 0x00007ff633e8ac1e (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x95ac1e)
2025-06-30T06:35:28.2886968Z # |  #6 0x00007ff633e8ba8f (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x95ba8f)
2025-06-30T06:35:28.2887908Z # |  #7 0x00007ff633e5d97f (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x92d97f)
2025-06-30T06:35:28.2890633Z # |  #8 0x00007ff633e5ccff (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x92ccff)
2025-06-30T06:35:28.2893785Z # |  #9 0x00007ff633e5b34e (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x92b34e)
2025-06-30T06:35:28.2895061Z # | #10 0x00007ff633ec9264 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x999264)
2025-06-30T06:35:28.2895970Z # | #11 0x00007ff633540826 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x10826)
2025-06-30T06:35:28.2897049Z # | #12 0x00007ff633543c7a (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0x13c7a)
2025-06-30T06:35:28.2897932Z # | #13 0x00007ff633fd2570 (c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe+0xaa2570)
2025-06-30T06:35:28.2898960Z # | #14 0x00007fff38c47ac4 (C:\Windows\System32\KERNEL32.DLL+0x17ac4)
2025-06-30T06:35:28.2899843Z # | #15 0x00007fff47f6a8c1 (C:\Windows\SYSTEM32\ntdll.dll+0x5a8c1)
2025-06-30T06:35:28.2900407Z # `-----------------------------
2025-06-30T06:35:28.2900795Z # error: command failed with exit status: 0x80000003
2025-06-30T06:35:28.2902042Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe' --codeview -
2025-06-30T06:35:28.2902765Z # .---command stderr------------
2025-06-30T06:35:28.2903547Z # | c:\_work\llvm-project\llvm-project\build\bin\llvm-readobj.exe: error: '<stdin>': The file was not recognized as a valid object file
2025-06-30T06:35:28.2904336Z # `-----------------------------
2025-06-30T06:35:28.2905346Z # error: command failed with exit status: 1
2025-06-30T06:35:28.2906362Z # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\MC\COFF\cv-def-range-gap.s'
2025-06-30T06:35:28.2907708Z # .---command stderr------------
2025-06-30T06:35:28.2908192Z # | FileCheck error: '<stdin>' is empty.
2025-06-30T06:35:28.2910412Z # | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\MC\COFF\cv-def-range-gap.s
2025-06-30T06:35:28.2911774Z # `-----------------------------
2025-06-30T06:35:28.2912153Z # error: command failed with exit status: 2
2025-06-30T06:35:28.2912442Z 
2025-06-30T06:35:28.2912533Z --

@anutosh491
Copy link
Member

These are the tests failing in the CI(for windows). Are these related to the changes??

Ahh, I think I see these failures on other PRs too (need to check main)

So probably this PR is not responsible for it.

@lhames
Copy link
Contributor

lhames commented Jul 2, 2025

So probably this PR is not responsible for it.

Yep -- those failures are in non-JIT paths. I don't think this PR could have caused them.

@anutosh491 anutosh491 merged commit d733c8e into llvm:main Jul 7, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 7, 2025

LLVM Buildbot has detected a new failure on builder flang-arm64-windows-msvc running on linaro-armv8-windows-msvc-01 while building llvm at step 7 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/207/builds/3501

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Parser/OpenMP/declare-reduction-operator.f90' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe -fc1 -fdebug-unparse -fopenmp C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90 | c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe --ignore-case C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90
# executed command: 'c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe' -fc1 -fdebug-unparse -fopenmp 'C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90'
# .---command stderr------------
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
# | Stack dump:
# | 0.	Program arguments: c:\\users\\tcwg\\llvm-worker\\flang-arm64-windows-msvc\\build\\bin\\flang.exe -fc1 -fdebug-unparse -fopenmp C:\\Users\\tcwg\\llvm-worker\\flang-arm64-windows-msvc\\llvm-project\\flang\\test\\Parser\\OpenMP\\declare-reduction-operator.f90
# | Exception Code: 0xC0000005
# |  #0 0x00007ff6cc9e2c0c (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a92c0c)
# |  #1 0x00007ff6cc9e08f4 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a908f4)
# |  #2 0x00007ff6cc9de788 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a8e788)
# |  #3 0x00007ff6cc9e449c (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a9449c)
# |  #4 0x00007ff6cc9de2f0 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a8e2f0)
# |  #5 0x00007ff6cb7fc8d4 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8ac8d4)
# |  #6 0x00007ff6cb845d34 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8f5d34)
# |  #7 0x00007ff6cb8eebf0 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x99ebf0)
# |  #8 0x00007ff6cb845170 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8f5170)
# |  #9 0x00007ff6cafe8ac8 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x98ac8)
# | #10 0x00007ff6caffea90 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0xaea90)
# | #11 0x00007ff6caf534e8 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x34e8)
# | #12 0x00007ff6caf520a4 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x20a4)
# | #13 0x00007ff6cfc10bf0 mlir::detail::FallbackTypeIDResolver::registerImplicitTypeID(class llvm::StringRef) (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x4cc0bf0)
# | #14 0x5712fff6cfc10c8c
# `-----------------------------
# error: command failed with exit status: 0xc0000005
# executed command: 'c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe' --ignore-case 'C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe --ignore-case C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90
# `-----------------------------
# error: command failed with exit status: 2

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants