[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xsmith-dev] Attempt at R7RS fuzzer causes racr internal error



Xsmith has a number of restrictions on how things can be named because
it has to pass identifiers through a racr DSL encoded as symbols.
Every so often I find that I missed a restriction.  Today I learned
that you can't have digits in them.  (Or at least not in some places
-- but xsmith forges symbols based on other symbols, so it's much
easier to just ban digits in symbols sent to racr than write code to
handle them more gracefully.  At least for now.)  I've just pushed a
commit that adds digits to the banned characters that it checks during
assembly.

So now you'll see a much better error message:

r7rs-fuzzer.rkt:101:1: add-to-grammar: Grammar names have to fit in RACR's DSL encoded as a symbol, and so can't have special characters -_<>:*+ or numbers in them.

So, unfortunately, you may have to write `rsevenrs`, or `rrrrrrrrs` or
something in `assemble-spec-components`.  Or just name it `fuzzer` or
something.


Unrelated to this bug, I'm glad you're excited about xsmith!  Xsmith
has been in a state of great instability, but it is rapidly
approaching a much more stable state.  I've actually been meaning to
write a set of rnrs fuzzers (well, and a lot of other fuzzers as well)
in the near future, as various features have been stabilizing.  I
don't say this to discourage you from writing one -- on the contrary
I'm sure you'll end up doing something different than I would which
could inform xsmith development.  I'm very interested to hear how it
goes for you.


On Wed, Mar 25, 2020 at 10:16:30AM +0100, Paulo Matos wrote:

Hi all,

I am now using xsmith from the master branch and something it generating
a racr internal error - likely my fault since I never used racr before.

The code is here:
https://gist.github.com/pmatos/d57e0788906afe53744d2395a52778b2

I am getting:
RACR exception: "Invalid AST rule"
'XsmithBaseNoder7rs->xsmithliftdepth-xsmithlifterwrapped ";"
"Unexpected" #\r "character."

The reason I am sending this email is because, due to the nature of the
error, I have no idea if this is indeed my fault. I cannot see any
unexpected character in my stream and do not know where to start since
the error leads me nowhere.

Could someone please help here?
By the way, I am aware this is very similar to Schemely but I did want
to type it myself and understand how things are done along the way. :)

Kind regards,
--
Paulo Matos