Yuescript icon indicating copy to clipboard operation
Yuescript copied to clipboard

Segfault when using macros via REPL

Open K4rakara opened this issue 4 years ago • 7 comments

Typing in the following code (or any other macro I've tried) into the REPL causes a segmentation fault on Linux:

macro name_of = (ident) -> "\"#{ident}\""
$name_of hi

K4rakara avatar Feb 24 '21 19:02 K4rakara

How you are using the Yuescript binary tool? Through luarocks install yuescript or make release? And what version of Yuescript and Lua are you using? The version of Yuescript 0.6.9 works fine with Lua 5.4 on my Linux environment. So I need more info to reproduce the problem.

pigpigyyy avatar Feb 25 '21 01:02 pigpigyyy

I'm using the luarocks version, yuescript 0.6.6, and lua 5.4 on Arch Linux.

K4rakara avatar Feb 25 '21 01:02 K4rakara

It should be the issue of older Yuescript. Try luarocks install yuescript again should fix the problem.

pigpigyyy avatar Feb 25 '21 02:02 pigpigyyy

Just updated to 0.6.9, but the issue still persists for all macros. :thinking:

K4rakara avatar Feb 25 '21 02:02 K4rakara

How about using the makefile with make release in the project folder to build the tool with the included Lua sources? It seems a Lua lib with mismatched headers got linked.

pigpigyyy avatar Feb 25 '21 02:02 pigpigyyy

Sorry for the delay-- I'm still getting the segmentation fault with make release.

Also--

This works:

> $
macro some_macro = (name) -> "\"#{name}\""
$some_macro HI
> $

This doesn't:

> macro some_macro = (name) -> "\"#{name}\""
> $some_macro HI

K4rakara avatar Feb 25 '21 03:02 K4rakara

Tested on archlinux with glibc 2.33 and located the problem. It is a bug in the compiler, and the minimal example to reproduce the issue is

global *
$f!

The problem should be fixed by the newest commit.

pigpigyyy avatar Mar 02 '21 07:03 pigpigyyy