adrian-thurston / ragel

Ragel State Machine Compiler
MIT License
524 stars 46 forks source link

"no machine instantiations to write" followed by segmentation fault #91

Open ryandesign opened 1 year ago

ryandesign commented 1 year ago

I can't process the file environment.rl from the mpw emulator project with ragel 7.0.4. I also reported this to that project.

Command:

% ragel -p -G2 -o environment.cpp environment.rl

Output:

environment.rl:162:9: assign: no machine instantiations to write
zsh: segmentation fault  ragel -p -G2 -o environment.cpp environment.rl

The crash log says:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libragel.0.dylib                       0x106191c5d InputData::writeStatement(CodeGenData*, InputLoc&, int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, bool, HostLang const*) + 59
1   libragel.0.dylib                       0x1061927c9 InputData::writeOutput(InputItem*) + 195
2   libragel.0.dylib                       0x106192ce4 InputData::flushRemaining() + 62
3   libragel.0.dylib                       0x10619303e InputData::processReduce() + 72
4   libragel.0.dylib                       0x10619522b InputData::main(int, char const**) + 91
5   ragel                                  0x105f929a9 main + 233
6   dyld                                   0x1134de51e start + 462

Using ragel 6.10 instead there is no problem.

Does this seem like a bug in ragel 7 or something that needs to be changed in the other project?

adrian-thurston commented 1 year ago

It's a bug in Ragel, picking it up.

adrian-thurston commented 1 year ago

This should be fixed by 65540b65ff09330b0293423e3fecc44e63f30614.