Closed computablee closed 3 months ago
Have you tested it with valgrind
?
I just did-- getting several Invalid read
errors.
@computablee sorry for the late reply. Could you show me the content of source.cxx
?
I'll close it until further information is given.
Hello! I'm encountering some bizarre nondeterministic parsing errors when using
cpp-peglib
. I cannot reproduce the issue on another system, but I have a "minimal reproducer" which demonstrates the issue on my machine (I'll give machine details further down the issue).Here's a small grammar which demonstrates the behavior on my machine:
(Side note: I know this grammar is extremely flawed, it's not meant to actually be a good or useful grammar!)
On my machine, the longer the input is, the higher probability of an unexpected parsing fail. It is nondeterministic, so:
The grammar was tested in the online sandbox and worked as intended, without any of the failures. Additionally, the grammar was tested on a different machine (with the same version of
cpp-peglib
and it also worked as intended.Relevant information:
cpp-peglib version: up-to-date with
master
as of May 7, 2024 compiler version: GNU g++11.4.0-1ubuntu1~22.04
environment: Ubuntu 22.04 podman containerCompiled with
g++ -std=c++17 -lpthread source.cxx -o parse
source.cxx
doesn't do anything special-- it simply callsenable_ast
,enable_packrat_parsing
, andast_to_s
. The packrat parsing does not seem to affect the bug.