Skip to content

Commit

Permalink
Disable multithreading in lx for now.
Browse files Browse the repository at this point in the history
Running this in a loop:

    $ while true; do sleep 0.1; ./build/bin/lx -l test < src/lx/lexer.lx \
        && echo ok; done

Produces a stream of intermittent failures. There appears to be
unsynchronized access to a shared/global resource, and races on
either `realloc`ing or `free`ing it can nondeterministically lead
to memory corruption.

For now, change to using only one thread -- issue #351 exists as a
reminder to-enable this once the underlying problem has been fixed.
  • Loading branch information
silentbicycle authored and katef committed Apr 28, 2021
1 parent 4ff6cba commit b921bb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ main(int argc, char *argv[])
print = lx_print_c;
keep_nfa = 0;
print_progress = 0;
concurrency = 4;
concurrency = 1;

/* TODO: populate options */
opt.anonymous_states = 1;
Expand Down

0 comments on commit b921bb3

Please sign in to comment.