Skip to content

Compiler crash when building Atomics on Windows #60543

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
stevapple opened this issue Aug 13, 2022 · 1 comment
Open

Compiler crash when building Atomics on Windows #60543

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

Comments

@stevapple
Copy link
Contributor

Describe the bug
The compiler crashes when building the Atomics module from apple/swift-atomics package.

Assertion failed: Loc.isValid() && "Can't get file characteristic of invalid loc!", file D:\a\1\s\llvm-project\clang\lib\Basic\SourceManager.cpp, line 1473                                                                     
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.                                                                                                    
Stack dump:                                                                                                     
0.      <eof> parser at end of file
 #0 0x00007ff6c9a04345 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4d14345)                                        
 #1 0x00007ffd1c16d88d (C:\Windows\System32\ucrtbase.dll+0x6d88d)                                                                                                    
 #2 0x00007ffd1c16e761 (C:\Windows\System32\ucrtbase.dll+0x6e761)                                                                                                    
 #3 0x00007ffd1c1700c1 (C:\Windows\System32\ucrtbase.dll+0x700c1)                                                                                                    
 #4 0x00007ffd1c1703f1 (C:\Windows\System32\ucrtbase.dll+0x703f1)                                                                                                    
 #5 0x00007ff6c989cf72 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4bacf72)                                        
 #6 0x00007ff6c9844ce8 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4b54ce8)                                        
 #7 0x00007ff6c5ef7a29 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x1207a29)                                        
 #8 0x00007ff6c5f12141 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x1222141)                                        
 #9 0x00007ff6c5f1934f (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x122934f)                                        
#10 0x00007ff6c84ef776 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x37ff776)                                        
#11 0x00007ff6c84e377e (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x37f377e)                                        
#12 0x00007ff6c84e0921 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x37f0921)                                        
#13 0x00007ff6c850a083 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x381a083)                                        
#14 0x00007ff6c822664c (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x353664c)                                        
#15 0x00007ff6c83a1ef4 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x36b1ef4)                                        
#16 0x00007ff6c820c795 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x351c795)                                        
#17 0x00007ff6c820c5a8 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x351c5a8)                                        
#18 0x00007ff6c81f5c2c (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x3505c2c)                                        
#19 0x00007ff6c81f2e3a (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x3502e3a)                                        
#20 0x00007ff6c99e4994 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4cf4994)                                        
#21 0x00007ff6c99e4b7f (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4cf4b7f)                                        
#22 0x00007ff6c99e454f (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe+0x4cf454f)                                        
#23 0x00007ffd1c12268a (C:\Windows\System32\ucrtbase.dll+0x2268a)                                                                                                    
#24 0x00007ffd1f487974 (C:\Windows\System32\KERNEL32.DLL+0x17974)                                                                                                    
#25 0x00007ffd1f8ba2f1 (C:\Windows\SYSTEM32\ntdll.dll+0x5a2f1) 

Steps To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/apple/swift-atomics;
  2. Change directory to swift-atomics;
  3. Run swift build.

Expected behavior
The Swift package should compile successfully.

Screenshots
D7B88A87-8B6F-45DD-B50A-EC37E051F8E6

Environment (please fill out the following information)

  • OS: Windows Server 2019 Datacenter (1809)
  • Swift version: 5.6.2
  • Visual Studio: Community 2019, 16.11.18

Additional context
Regarding to #60534, you should first run mklink /D C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\clang C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\clang\13.0.0 to correctly set up Clang headers.

@stevapple stevapple added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Aug 13, 2022
@stevapple
Copy link
Contributor Author

Anyone to provide some hints into the problem👀 Blocking Atomics also means blocking NIO and some other libraries as well.

# for free to join this conversation on GitHub. Already have an account? # 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

1 participant