-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi-dict and multi-thread tests crash with a segmentation fault on macOS when built with pcre2 #1514
Comments
The problem with PCRE2 in compilers that don't support c11 threads happens only with multi-threaded programs that use the LG library in different threads simultaneously. I think most users never do that, and since PCER2 is faster and better than the alternative libraries, it should remain the default. If desired, |
Hi @ryandesign -- if you will allow me, I'd like to provide some deep history and general, opinionated twitter-thread commentary ...
If you want to learn multi-threaded programming, above is a good starter project. |
With the latest code in master,
make check
fails on macOS if link-grammar is built with pcre2 support. The multi-dict and multi-thread tests crash with a segmentation fault, which doesn't happen if I disable pcre2 with the--with-regexlib=c
configure argument. From the crash log, multi-dict crashed here:while multi-thread crashed here:
@ampli said in #1505 (comment) that this is because:
My brief searching suggests that C11 threads (threads.h) are not well supported and pthreads is suggested as the recommended alternative. pthreads are already used elsewhere in the code:
link-grammar/link-grammar/tokenize/spellcheck-hun.c
Line 22 in 69c026f
Maybe using a single threading library for the entire code base would be a good idea. I can't help with that, however, as I haven't written any multithreaded code before.
The text was updated successfully, but these errors were encountered: