From ae73900f4cb4e3640621cc94511ed2fcb8448517 Mon Sep 17 00:00:00 2001 From: Scott Vokes Date: Wed, 28 Apr 2021 16:08:18 -0400 Subject: [PATCH] Disable multithreading in lx for now. 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. --- src/lx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lx/main.c b/src/lx/main.c index c008d4c53..516634b83 100644 --- a/src/lx/main.c +++ b/src/lx/main.c @@ -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;