Closed ghost closed 1 year ago
Uh. Good question, I have no idea what's happening there offhand. The bootstrap compiler seems to be segfaulting. Any chance you could get a backtrace of that command? (./neat_bootstrap -j src/main.nt -O -o neat
)
Also you can put triple backticks before and after your paste to get proper formatting.
here is the output:
Reading symbols from neat_bootstrap...
(gdb) run -j src/main.nt -O -o neat
Starting program: /ev/çizeylemcil/neat-v0.2.2-gcc/neat_bootstrap -j src/main.nt -O -o neat
[Detaching after vfork from child process 5808]
[New LWP 5809]
[New LWP 5810]
[New LWP 5811]
[New LWP 5812]
# stageM addQuasiQuotingMacro
Thread 4 "neat_bootstrap" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 5811]
0x000055555573ceef in compiler130_module_neat_parser_ParserImpl_verify_void_0_ ()
Idea! Can you check if this happens in alpine docker? If so, that'd be an easy way to get something I can actually reproduce.
edit: Alright. hm. That helps less than I'd hoped...
alpine 3.17 chroot gives same error:
+ cat
+ '[' 64 == 32 ']'
+ ./neat_bootstrap -j src/main.nt -O -o neat
./build.sh: line 56: 12832 Segmentation fault ./neat_bootstrap -j src/main.nt -O -o neat
alpine gdb gives more info:
(gdb) run -j src/main.nt -O -o neat
Starting program: /neat-v0.2.2-gcc/neat_bootstrap -j src/main.nt -O -o neat
[Detaching after vfork from child process 21205]
[New LWP 21206]
[New LWP 21207]
[New LWP 21208]
[New LWP 21209]
# stageM addQuasiQuotingMacro
[Detaching after fork from child process 21210]
$ gcc -c -fpic -fno-strict-aliasing .obj/module_A533D8106D4B4F61.c -o .obj/A533D8106D4B4F61.o [&21210]
Thread 4 "neat_bootstrap" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 21208]
0x000055555587f020 in compiler130_module_neat_stuff_Resolver_resolve_either_void_compiler130_module_neat_base_class_Error_3_compiler130_module_neat_base_struct_Context_compiler130_module_neat_base_struct_LocRange_int ()
Well that's a completely different location for no reason...
Let me have a look.
well now it gives this info:
(gdb) run -j src/main.nt -O -o neat
Starting program: /neat-v0.2.2-gcc/neat_bootstrap -j src/main.nt -O -o neat
[Detaching after vfork from child process 23613]
[New LWP 23614]
[New LWP 23615]
[New LWP 23616]
[New LWP 23617]
Thread 2 "neat_bootstrap" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 23614]
0x00005555557e567e in compiler130_module_neat_stuff_parseExpressionLeaf_either_nullable_compiler130_module_neat_base_class_ASTSymbol_compiler130_module_neat_base_class_Error_2_compiler130_module_neat_base_class_Parser_compiler130_module_neat_base_class_LexicalContext ()
Ah. musl's stack size is too small for the compiler.
You can work around this by adding -Wl,-z,stack-size=8388608
to the "gcc" line in build.sh
.
How can I detect your system? I don't think I should always set that flag.
edit: Alternately, you can remove the -j
flag. I think this only happens cause neat is trying to do a threaded compile without specifying a stack size..... Which I should probably fix.
ok the stack size fixed the segfault. You could check if "/lib/ld-musl-x86_64.so.1" is present in the system inside the build.sh file then you could add "-Wl,-z,stack-size=8388608" to the CFLAGS option.
Released 0.2.3 which should fix it without any changes to build scripts. Can you please confirm?
Well it works fine with the new release, thanks for the time and effort!
I'm trying to build v0.2.2-gcc and get this error:
Edit: I get the same error with the llvm version:
My system is based on musl libc, a custom x64 linux distro.