Open damon-kwok opened 4 years ago
I'm unable to verify on Ubuntu 18.04 with 0.33.1. I get the correct syntax error message.
Can't replicate on Ubuntu 18.04 with latest master. I get the correct syntax error message.
@damon-kwok you'll need to provide more detailed replication instructions.
@SeanTAllen OS: Windows10 Ponyc: 0.33.2 0.34.1
ponyc --version
0.34.1-87b473d [release]
Compiled with: LLVM 9.0.1 -- MSVC-19.26.28803.1-x64 1926
ponyc
Building builtin -> D:\msys64\home\damon\.ome_local\repo\ponyc-git\build\install\packages\builtin
Building . -> d:\msys64\home\damon\workspace\projects\pony\crash_ast
Building collections -> D:\msys64\home\damon\.ome_local\repo\ponyc-git\build\install\packages\collections
Building ponytest -> D:\msys64\home\damon\.ome_local\repo\ponyc-git\build\install\packages\ponytest
Building time -> D:\msys64\home\damon\.ome_local\repo\ponyc-git\build\install\packages\time
Building random -> D:\msys64\home\damon\.ome_local\repo\ponyc-git\build\install\packages\random
D:\msys64\home\damon\.ome_local\repo\ponyc-git\src\libponyc\ast\ast.c:901: ast_has_annotation: Assertion `ast != NULL` failed.
Backtrace:
() [00007FF616C70394]
() [00007FF616BC0515]
() [00007FF616C22D6A]
() [00007FF616C2C00A]
() [00007FF616BE0A28]
() [00007FF616BC4935]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC48D7]
() [00007FF616BC426E]
() [00007FF616BC4679]
() [00007FF616BC7E81]
() [00007FF616BBC4E4]
() [00007FF616BBC6E1]
(pony_asio_event_set_writeable) [00007FF61782DEC4]
(BaseThreadInitThunk) [00007FFE9E167BD4]
(RtlUserThreadStart) [00007FFE9E68CE51]
This is an optimised version of ponyc: the backtrace may be imprecise or incorrect.
Use a debug version to get more meaningful information.
Compilation exited abnormally with code 9 at Fri May 8 10:58:18
@kulibali can you see if you get an error with a windows build?
Yeah, I can repro this on Windows.
@kulibali what's a better title for this issue?
Given that this is in ast_has_annotation
. This is probably in the codegen pass, which might help explain why it only occurs on windows - that's one of the only places in the compiler that is platform-specific.
Sylvan also noted in today's sync call that the reference to asio in the backtrace is probably a red herring because it isn't involved in ponyc - probably the backtrace addresses being totally bogus and just happening to match a function or two by coincidence.
Here's a debug backtrace:
Building builtin -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\packages\builtin
Building . -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\build\test_3529
Building collections -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\packages\collections
Building ponytest -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\packages\ponytest
Building time -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\packages\time
Building random -> C:\Users\Gordon\Dev\Pony\ponyc_llvm901\packages\random
C:\Users\Gordon\Dev\Pony\ponyc_llvm901\src\libponyc\ast\ast.c:901: ast_has_annotation: Assertion `ast != NULL` failed.
Backtrace:
(ponyint_assert_fail) [00007FF6A689C46F]
(ast_has_annotation) [00007FF6A674123D]
(is_bare) [00007FF6A67DBE85]
(is_bare) [00007FF6A67DBE9E]
(check_constraints) [00007FF6A67E6E9D]
(expr_nominal) [00007FF6A67F89E5]
(pass_expr) [00007FF6A6784A13]
(ast_visit) [00007FF6A67490FA]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(ast_visit) [00007FF6A6749036]
(visit_pass) [00007FF6A6749484]
(ast_passes) [00007FF6A67498F0]
(ast_passes_program) [00007FF6A6748B68]
(program_load) [00007FF6A674ADCF]
(compile_package) [00007FF6A673BFEC]
(main) [00007FF6A673C295]
(__scrt_common_main_seh) [00007FF6A7AA5B5C]
(BaseThreadInitThunk) [00007FF80E8E7BD4]
(RtlUserThreadStart) [00007FF80F36CE51]
Thanks, Gordon. So I was wrong about it being in codegen - it's in the expr pass.
You may (or may not) be able to fix this crash by modifying this line: https://github.com/ponylang/ponyc/blob/e55db85d928ce34386edd39b3c135977aba5eb65/src/libponyc/type/reify.c#L380
To look like:
if(typearg && is_bare(typearg))
This is my minimal example: main.pony
any_map.pony:
any_set.pony: