LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 44336 - Basic OrcJIT functional doesn't work with MSVC
Summary: Basic OrcJIT functional doesn't work with MSVC
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: OrcJIT (show other bugs)
Version: 9.0
Hardware: PC Windows XP
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: 44337
  Show dependency tree
 
Reported: 2019-12-18 08:59 PST by Alexander Kornilov
Modified: 2020-01-22 15:02 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Example of using OrcJIT from LLVM 9.0.0 sources (2.81 KB, text/x-c++src)
2019-12-18 08:59 PST, Alexander Kornilov
Details
The patch which fixes the issue. (2.17 KB, patch)
2019-12-20 08:33 PST, Alexander Kornilov
Details
The patch which fixes the issue and #44337 [updated]. (2.26 KB, patch)
2019-12-27 09:06 PST, Alexander Kornilov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kornilov 2019-12-18 08:59:57 PST
Created attachment 22945 [details]
Example of using OrcJIT from LLVM 9.0.0 sources

Precondition:
1) LLVM 9.0.0 builded by MSVC 2019 in Debug build variant.
2) Builded application: OrcJIT example from llvm-9.0.0.src/examples/HowToUseLLJIT/HowToUseLLJIT.cpp (linked with LLVM build from step (1)).

Steps to reproduce:
1) Run application.

Expected result:
The application should work fine.

Actual result:
The application failed on an assertion in OrcJIT core (Core.cpp:384):

Assertion failed: I->second == KV.second.getFlags() && "Resolving symbol with incorrect flags", file C:\Workspace\llvm-9.0.0.src\lib\ExecutionEngine\Orc\Core.cpp, line 384
Stack dump:
0.	Program arguments: llvm-app.exe 
 #0 0x000000014259317c (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x29d317c)
 #1 0x000007feeac8bba1 (C:\Windows\system32\ucrtbased.dll+0x6bba1)
 #2 0x000007feeac8d7f9 (C:\Windows\system32\ucrtbased.dll+0x6d7f9)
 #3 0x000007feeac9302f (C:\Windows\system32\ucrtbased.dll+0x7302f)
 #4 0x000007feeac91001 (C:\Windows\system32\ucrtbased.dll+0x71001)
 #5 0x000007feeac9398f (C:\Windows\system32\ucrtbased.dll+0x7398f)
 #6 0x000000014262d5eb (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a6d5eb)
 #7 0x00000001426f25ed (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b325ed)
 #8 0x00000001426fe0de (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b3e0de)
 #9 0x00000001426f5051 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b35051)
#10 0x00000001426f9d6a (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b39d6a)
#11 0x00000001426f4f5a (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b34f5a)
#12 0x00000001426ffe9f (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b3fe9f)
#13 0x00000001427ca296 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2c0a296)
#14 0x00000001427b0649 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2bf0649)
#15 0x00000001426f21b9 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b321b9)
#16 0x00000001426eff4b (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b2ff4b)
#17 0x000000014270da72 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b4da72)
#18 0x000000014262807e (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a6807e)
#19 0x000000014267c863 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2abc863)
#20 0x000000014263fc03 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a7fc03)
#21 0x000000014264c7b8 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a8c7b8)
#22 0x000000014263fb68 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a7fb68)
#23 0x000000014266b05a (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2aab05a)
#24 0x0000000142664bc4 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2aa4bc4)
#25 0x0000000142675199 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2ab5199)
#26 0x00000001426356dc (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a756dc)
#27 0x0000000142634b5d (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a74b5d)
#28 0x0000000142634d96 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a74d96)
#29 0x0000000142635041 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a75041)
#30 0x0000000142611f06 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2a51f06)
#31 0x000000013fd50979 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x190979)
#32 0x000000013fd50a72 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x190a72)
#33 0x000000013fd41c16 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x181c16)
#34 0x0000000142715149 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b55149)
#35 0x000000014271502e (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b5502e)
#36 0x0000000142714eee (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b54eee)
#37 0x00000001427151d9 (C:\LoggerSoft\Public\SourceForge\gradle-cpp\llvm-app\build\exe\main\debug\llvm-app.exe+0x2b551d9)
#38 0x000000007737652d (C:\Windows\system32\kernel32.dll+0x1652d)
#39 0x00000000775ac541 (C:\Windows\SYSTEM32\ntdll.dll+0x2c541)
Comment 1 Alexander Kornilov 2019-12-20 08:32:35 PST
The root cause of the issue that the resolved symbol on COFF doesn't have flag JITSymbolFlags::Exported.
Comment 2 Alexander Kornilov 2019-12-20 08:33:33 PST
Created attachment 22954 [details]
The patch which fixes the issue.
Comment 3 Alexander Kornilov 2019-12-27 09:06:08 PST
Created attachment 22967 [details]
The patch which fixes the issue and #44337 [updated].
Comment 4 Lang Hames 2020-01-22 15:02:12 PST
Closing as fixed by 84217ad6611, based on discussion in http://llvm.org/PR44337.