Skip to content

ci: try to build LLVM with thread support #2433

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

Closed
wants to merge 1 commit into from
Closed

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Dec 28, 2021

This should fix a number of concurrency/threading issues.

@aykevl aykevl force-pushed the windows-llvm-threads branch from 3e16267 to b5aaa71 Compare December 28, 2021 14:44
@aykevl
Copy link
Member Author

aykevl commented Dec 28, 2021

Ready for review! This seems to be working.

@aykevl
Copy link
Member Author

aykevl commented Dec 28, 2021

I think this is the underlying issue for #775.

@niaow
Copy link
Member

niaow commented Dec 28, 2021

The smoketests seem to be taking quite a while to run, not sure if something broke

@aykevl
Copy link
Member Author

aykevl commented Dec 29, 2021

The smoketests seem to be taking quite a while to run, not sure if something broke

They do sometimes, not sure why. They're running on Linux so it's unrelated to this PR.

@aykevl aykevl force-pushed the windows-llvm-threads branch from b5aaa71 to d4f7df9 Compare December 29, 2021 13:07
@deadprogram
Copy link
Member

Seems like it is the Windows smoke tests that are getting stuck.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

I think I hit something with smoke tests getting stuck on windows back when I added asyncify, however I thought I fixed it.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

If I remember correctly, the issue was that there was some crash happening and the default behavior was to stop the running process rather than exiting. I do not remember what was triggering the crash though, and I cant seem to find it.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

Nevermind, I remembered incorrectly. I encountered this issue in #2035

@niaow
Copy link
Member

niaow commented Dec 30, 2021

It could potentially be this: #2035 (comment)

@aykevl
Copy link
Member Author

aykevl commented Dec 30, 2021

The smoketests seem to be taking quite a while to run, not sure if something broke

They do sometimes, not sure why. They're running on Linux so it's unrelated to this PR.

Nevermind, I think I was a bit tired when writing that comment.
Smoketests != TinyHCI 🤦

@aykevl
Copy link
Member Author

aykevl commented Dec 30, 2021

It could potentially be this: #2035 (comment)

Probably not, because it's stuck here:

build/tinygo build -size short -o test.hex -target=pca10040            examples/blinky1

This is not WebAssembly so ExternalInt64AsPtr is not used.

I should also add that the whole point of this PR is to fix a problem on Windows when LLVM was built with assertions enabled. I got an assertion failure every time unless I compiled with -p=1. So it should fix an actual bug, but somehow seems to trigger other bugs...
Maybe I can do a new Windows LLVM build with threading and assertions enabled to debug this locally. Not looking forward to that because building LLVM takes a looong time on my laptop.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

This is not WebAssembly so ExternalInt64AsPtr is not used.

That makes sense, although I still strongly suspect this is at least a similar issue.

Maybe I can do a new Windows LLVM build with threading and assertions enabled to debug this locally. Not looking forward to that because building LLVM takes a looong time on my laptop.

I can try this once I finish what I am currently working on then.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

So I got an assert build to compile, but then clang crashed while building wasi-libc

crash log
#
# Build the startup files.
#
cd "C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/build" && \
C:/Users/Nia/Desktop/tinygo/llvm-build/bin/clang -O2 -g -DNDEBUG --target=wasm32-wasi -fno-trapping-math -Wall -Wextra -Werror -Wno-null-pointer-arithmetic -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-ignored-attributes -Wno-missing-braces -Wno-ignored-pragmas -Wno-unused-but-set-variable -Wno-unknown-warning-option -mthread-model single --sysroot="C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot" -IC:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/headers/private -IC:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src/include -IC:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src -c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-command.c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-reactor.c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1.c -MD -MP && \
mkdir -p "C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/lib/wasm32-wasi" && \
mv *.o "C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/lib/wasm32-wasi"
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\bin\\clang.exe -cc1 -triple wasm32-unknown-wasi -emit-obj --mrelax-relocations -disable-free -main-file-name crt1-command.c -mrelocation-model static -mthread-model single -mframe-pointer=none -fno-rounding-math -ffp-exception-behavior=ignore -mconstructor-aliases -target-cpu generic -fvisibility hidden -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1 -dependency-file crt1-command.d -MT crt1-command.o -sys-header-deps -MP -D NDEBUG -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/headers/private -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src/include -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src -isysroot C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot -internal-isystem C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1\\include -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include/wasm32-wasi -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include -O2 -Wall -Wextra -Werror -Wno-null-pointer-arithmetic -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-ignored-attributes -Wno-missing-braces -Wno-ignored-pragmas -Wno-unused-but-set-variable -Wno-unknown-warning-option -fdebug-compilation-dir C:\\Users\\Nia\\Desktop\\tinygo\\lib\\wasi-libc\\build -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -o crt1-command.o -x c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-command.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-command.c'.
4.      Running pass 'WebAssembly CFG Sort' on function '@_start'
0x00000000046CABD0 (0x0000000000000016 0x0000000000000041 0x0000000000000016 0x00007FFEF4E246B8)
0x00007FFEF4DBADFB (0x0000000000000001 0x00007FFEF4DE1EFF 0x000000000BE36990 0x000000000C3D4960), raise() + 0x21B bytes(s)
0x00007FFEF4DBF1FB (0x00007FFEF4E1FA60 0x0000000005EAFC30 0x000000000C40BD60 0x0000000000000020), abort() + 0x1B bytes(s)
0x0000000003DB2776 (0x000000000C368DC8 0x000000000C3D4960 0x00000000073EB498 0x000000000C368DC8)
0x0000000003DB2826 (0x00000000074C0000 0x0000000000000000 0x00000000073EB500 0x00000000073EB500)
0x0000000000D5D994 (0x000000000C3FA5C0 0x000000000555B85C 0x000000000C387C10 0x000000000C389740)
0x0000000000D5F24B (0x000000000C31EF70 0x000000000C3FA5C0 0x000000000C40B2B0 0x00007FFEF53FA46C)
0x000000000115C830 (0x000000000C282818 0x000000000C31EB10 0x00000000073EBD30 0x00000000073EBD20)
0x0000000001525AFD (0x00000000073EBED0 0x000000000C35F680 0x000000000C35F6A0 0x000000000C38ED40)
0x000000000152657C (0x00004DA707F5ADC8 0x000000000C337470 0x0000000000000000 0x00007FFECD4257F6)
0x0000000001525436 (0x000000000C35F200 0x000000000C3385A0 0x000000000000001F 0x0000000000000000)
0x0000000001D6AB8C (0x0000000000000000 0x00000000074C0000 0x00000000073EC4B0 0x0000000000000000)
0x0000000001D6C94F (0x000000000BE683B0 0x00000000074C8510 0x0000000000000200 0x000000000BE1B440)
0x0000000004310046 (0x000000000BEBA650 0x000000000BEAC970 0x0000000000000000 0x000000000232CD26)
0x0000000002CD17B9 (0x00000000074C0150 0x00000000000001E5 0x000000000000016F 0x00000000E00000E0)
0x00000000029EB32B (0x0000000000000008 0x0000000000000019 0x00000000056A2536 0x0000000000000000)
0x000000000237C709 (0x000000000BE352B0 0x00000000029E4EB5 0x00000000000000E8 0x00000000073EDEA0)
0x000000000232FE0D (0x0000000000000000 0x0000000000000000 0x00000000073EE0F0 0x0000000000000001)
0x0000000002434B7F (0x000000000BE15C00 0x00007FFEF555A320 0x00000000073EE260 0x000000000BE33574)
0x0000000000402A2F (0x00000000073EE850 0x000000000BE33574 0x0000000000401B90 0x000000000000000D)
0x000000000040174F (0x00000000073EEA38 0x0000000001A87820 0x00007FFE00000000 0x0000000000000000)
0x000000000465FED9 (0x000000000000004A 0x000000000BE222C0 0x00000000063DDA00 0x0000000000000000)
0x00000000004013C7 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00000000004014FB (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFEF4737034 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFEF5442651 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\bin\\clang.exe -cc1 -triple wasm32-unknown-wasi -emit-obj --mrelax-relocations -disable-free -main-file-name crt1-reactor.c -mrelocation-model static -mthread-model single -mframe-pointer=none -fno-rounding-math -ffp-exception-behavior=ignore -mconstructor-aliases -target-cpu generic -fvisibility hidden -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1 -dependency-file crt1-reactor.d -MT crt1-reactor.o -sys-header-deps -MP -D NDEBUG -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/headers/private -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src/include -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src -isysroot C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot -internal-isystem C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1\\include -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include/wasm32-wasi -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include -O2 -Wall -Wextra -Werror -Wno-null-pointer-arithmetic -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-ignored-attributes -Wno-missing-braces -Wno-ignored-pragmas -Wno-unused-but-set-variable -Wno-unknown-warning-option -fdebug-compilation-dir C:\\Users\\Nia\\Desktop\\tinygo\\lib\\wasi-libc\\build -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -o crt1-reactor.o -x c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-reactor.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1-reactor.c'.
4.      Running pass 'WebAssembly CFG Sort' on function '@_initialize'
0x00000000046CABD0 (0x0000000000000016 0x0000000000000041 0x0000000000000016 0x00007FFEF4E246B8)
0x00007FFEF4DBADFB (0x0000000000000001 0x00007FFEF4DE1EFF 0x000000000C2DE200 0x000000000C37B840), raise() + 0x21B bytes(s)
0x00007FFEF4DBF1FB (0x00007FFEF4E1FA60 0x0000000005EAFC30 0x000000000C3A2DB0 0x0000000000000020), abort() + 0x1B bytes(s)
0x0000000003DB2776 (0x000000000C2BB5B8 0x000000000C37B840 0x00000000073EB498 0x000000000C2BB5B8)
0x0000000003DB2826 (0x00000000073F0000 0x0000000000000000 0x00000000073EB500 0x00000000073EB500)
0x0000000000D5D994 (0x000000000C37B980 0x000000000555B85C 0x000000000C325DD0 0x000000000C30E550)
0x0000000000D5F24B (0x000000000C315D10 0x000000000C37B980 0x000000000A792D94 0x000000000A790150)
0x000000000115C830 (0x000000000A6DB428 0x000000000C316020 0x00000000073EBD30 0x00000000073EBD20)
0x0000000001525AFD (0x00000000073EBED0 0x000000000C305AB0 0x000000000C305AD0 0x000000000C307450)
0x000000000152657C (0x00007F391BFEF885 0x000000000A668750 0x0000000000000000 0x00007FFECD4257F6)
0x0000000001525436 (0x000000000C305630 0x000000000C2E5130 0x000000000000001F 0x0000000000000000)
0x0000000001D6AB8C (0x000000000A719540 0x0000000000000127 0x00000000073EC4B0 0x00000000073EC550)
0x0000000001D6C94F (0x000000000A6983B0 0x000000000A798510 0x0000000000000200 0x000000000A64B440)
0x0000000004310046 (0x000000000A6EA650 0x000000000A6DC970 0x0000000000000000 0x000000000232CD26)
0x0000000002CD17B9 (0x000000000A790150 0x00000000000001E5 0x000000000000016F 0x00000000E00000E0)
0x00000000029EB32B (0x0000000000000008 0x0000000000000019 0x00000000056A2536 0x0000000000000000)
0x000000000237C709 (0x000000000A6652B0 0x00000000029E4EB5 0x00000000000000E8 0x00000000073EDEA0)
0x000000000232FE0D (0x0000000000000000 0x0000000000000000 0x00000000073EE0F0 0x0000000000000001)
0x0000000002434B7F (0x000000000A645C00 0x00007FFEF555A320 0x00000000073EE260 0x000000000A663574)
0x0000000000402A2F (0x00000000073EE850 0x000000000A663574 0x0000000000401B90 0x000000000000000D)
0x000000000040174F (0x00000000073EEA38 0x0000000001A87820 0x00007FFE00000000 0x0000000000000000)
0x000000000465FED9 (0x000000000000004A 0x000000000A6522C0 0x00000000063DDA00 0x0000000000000000)
0x00000000004013C7 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00000000004014FB (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFEF4737034 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFEF5442651 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\bin\\clang.exe -cc1 -triple wasm32-unknown-wasi -emit-obj --mrelax-relocations -disable-free -main-file-name crt1.c -mrelocation-model static -mthread-model single -mframe-pointer=none -fno-rounding-math -ffp-exception-behavior=ignore -mconstructor-aliases -target-cpu generic -fvisibility hidden -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1 -dependency-file crt1.d -MT crt1.o -sys-header-deps -MP -D NDEBUG -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/headers/private -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src/include -I C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/cloudlibc/src -isysroot C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot -internal-isystem C:\\Users\\Nia\\Desktop\\tinygo\\llvm-build\\lib\\clang\\12.0.1\\include -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include/wasm32-wasi -internal-isystem C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/sysroot/include -O2 -Wall -Wextra -Werror -Wno-null-pointer-arithmetic -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-ignored-attributes -Wno-missing-braces -Wno-ignored-pragmas -Wno-unused-but-set-variable -Wno-unknown-warning-option -fdebug-compilation-dir C:\\Users\\Nia\\Desktop\\tinygo\\lib\\wasi-libc\\build -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -o crt1.o -x c C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/Users/Nia/Desktop/tinygo/lib/wasi-libc/libc-bottom-half/crt/crt1.c'.
4.      Running pass 'WebAssembly CFG Sort' on function '@_start'
0x00000000046CABD0 (0x0000000000000016 0x0000000000000041 0x0000000000000016 0x00007FFEF4E246B8)
0x00007FFEF4DBADFB (0x0000000000000001 0x00007FFEF4DE1EFF 0x000000000C284590 0x000000000C2DA450), raise() + 0x21B bytes(s)
0x00007FFEF4DBF1FB (0x00007FFEF4E1FA60 0x0000000005EAFC30 0x000000000C336500 0x0000000000000020), abort() + 0x1B bytes(s)
0x0000000003DB2776 (0x000000000C2346A8 0x000000000C2DA450 0x00000000073EB498 0x000000000C2346A8)
0x0000000003DB2826 (0x00000000073F0000 0x0000000000000000 0x00000000073EB500 0x00000000073EB500)
0x0000000000D5D994 (0x000000000C300200 0x000000000555B85C 0x000000000C261AC0 0x000000000C2A7A60)
0x0000000000D5F24B (0x0000000000000800 0x000000000C300200 0x000000000C335CF0 0x00007FFEF53FA46C)
0x000000000115C830 (0x000000000BE497C8 0x000000000C209630 0x00000000073EBD30 0x00000000073EBD20)
0x0000000001525AFD (0x00000000073EBED0 0x000000000C28A910 0x000000000C28A930 0x000000000C296340)
0x000000000152657C (0x0000F6E7A7C55DD1 0x000000000BD98650 0x0000000000000000 0x00007FFECD4257F6)
0x0000000001525436 (0x000000000C28A490 0x000000000C253050 0x000000000000001F 0x0000000000000000)
0x0000000001D6AB8C (0x00000000073EC480 0x00000000073EC430 0x00000000073EC4B0 0x00000000073EC960)
0x0000000001D6C94F (0x000000000BDCD5F0 0x000000000BD94E50 0x0000000000000200 0x000000000A7484E0)
0x0000000004310046 (0x000000000BE1A720 0x000000000BE0CA40 0x0000000000000000 0x000000000232CD26)
0x0000000002CD17B9 (0x000000000A740150 0x00000000000001D9 0x0000000000000163 0x00000000D50000D5)
0x00000000029EB32B (0x0000000000000008 0x0000000000000019 0x00000000056A2536 0x0000000000000000)
0x000000000237C709 (0x000000000BDC72E0 0x00000000029E4EB5 0x00000000000000E8 0x00000000073EDEA0)
0x000000000232FE0D (0x0000000000000000 0x0000000000000000 0x00000000073EE0F0 0x0000000000000001)
0x0000000002434B7F (0x000000000BD75CE0 0x00007FFEF555A320 0x00000000073EE260 0x000000000BD9344C)
0x0000000000402A2F (0x00000000073EE850 0x000000000BD9344C 0x0000000000401B90 0x000000000000000D)
0x000000000040174F (0x00000000073EEA38 0x0000000001A87820 0x00007FFE00000000 0x0000000000000000)
0x000000000465FED9 (0x000000000000004A 0x000000000BD822E0 0x00000000063DDA00 0x0000000000000000)
0x00000000004013C7 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00000000004014FB (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFEF4737034 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFEF5442651 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 12.0.1 (https://github.com/tinygo-org/llvm-project f2529f3698eea5dcb20e5970960c200c7b0e499a)
Target: wasm32-unknown-wasi
Thread model: single
InstalledDir: C:\Users\Nia\Desktop\tinygo\llvm-build\bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:\Users\Nia\AppData\Local\Temp\crt1-command-f225ba.c
clang: note: diagnostic msg: C:\Users\Nia\AppData\Local\Temp\crt1-reactor-64e14e.c
clang: note: diagnostic msg: C:\Users\Nia\AppData\Local\Temp\crt1-2aaf7a.c
clang: note: diagnostic msg: C:\Users\Nia\AppData\Local\Temp\crt1-command-f225ba.sh
clang: note: diagnostic msg:

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

The backtrace here is unfortunately not too helpful. I might try to see if I can get more info with a debugger, but it looks like we have some issue with WebAssembly CFG Sort.

@niaow
Copy link
Member

niaow commented Dec 30, 2021

GDB seems to be a bit more helpful

GDB backtrace
Thread 1 received signal SIGILL, Illegal instruction.
0x00000000046cabd0 in HandleAbort.cold.231 ()
(gdb) bt
#0  0x00000000046cabd0 in HandleAbort.cold.231 ()
#1  0x00007ffef4dbadfb in raise () from C:\Windows\System32\msvcrt.dll
#2  0x00007ffef4dbf1fb in msvcrt!abort () from C:\Windows\System32\msvcrt.dll
#3  0x0000000003db2776 in _wassert ()
#4  0x0000000003db2826 in _assert ()
#5  0x0000000000d5d994 in sortBlocks(llvm::MachineFunction&, llvm::MachineLoopInfo const&, llvm::WebAssemblyExceptionInfo const&, llvm::MachineDominatorTree const&) ()
#6  0x0000000000d5f24b in (anonymous namespace)::WebAssemblyCFGSort::runOnMachineFunction(llvm::MachineFunction&) ()
#7  0x000000000115c830 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) [clone .part.51] ()
#8  0x0000000001525afd in llvm::FPPassManager::runOnFunction(llvm::Function&)
    ()
#9  0x000000000152657c in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#10 0x0000000001525436 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#11 0x0000000001d6ab8c in (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) ()
#12 0x0000000001d6c94f in clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) ()
#13 0x0000000004310046 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#14 0x0000000002cd17b9 in clang::ParseAST(clang::Sema&, bool, bool) ()
#15 0x00000000029eb32b in clang::CodeGenAction::ExecuteAction() ()
#16 0x000000000237c709 in clang::FrontendAction::Execute() ()
#17 0x000000000232fe0d in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#18 0x0000000002434b7f in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#19 0x0000000000402a2f in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()
#20 0x000000000040174f in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
    ()
#21 0x000000000465fed9 in main ()

@niaow
Copy link
Member

niaow commented Dec 30, 2021

I think I may need to rebuild with debug symbols to get enough info to figure out what is going on

@aykevl aykevl force-pushed the windows-llvm-threads branch from d4f7df9 to 799aadd Compare April 27, 2022 15:43
@aykevl aykevl marked this pull request as draft April 27, 2022 15:43
@aykevl
Copy link
Member Author

aykevl commented Apr 27, 2022

Rebased and testing some more...
I think this will fix a number of issues on Windows.

So I got an assert build to compile, but then clang crashed while building wasi-libc
[...]

The backtrace here is unfortunately not too helpful. I might try to see if I can get more info with a debugger, but it looks like we have some issue with WebAssembly CFG Sort.

I've reported this upstream here: llvm/llvm-project#55120
Still trying to figure out what's going wrong here.

@aykevl aykevl force-pushed the windows-llvm-threads branch from 799aadd to 459f8c6 Compare April 27, 2022 19:25
@aykevl aykevl marked this pull request as ready for review April 27, 2022 19:25
@aykevl aykevl force-pushed the windows-llvm-threads branch from 459f8c6 to 683381d Compare September 2, 2022 14:15
This should fix a number of concurrency/threading issues.
@aykevl aykevl force-pushed the windows-llvm-threads branch from 683381d to f4f2b8e Compare September 2, 2022 14:16
@aykevl
Copy link
Member Author

aykevl commented Sep 3, 2022

This doesn't seem to work, unfortunately. Not sure what's going on: the "TinyGo Test" step hangs. It looks like go test . doesn't even produce any output (but other tests do work, for some reason).

I think I'm giving up on this for now.

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.

3 participants