-
Notifications
You must be signed in to change notification settings - Fork 110
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
segmentation fault occurs with -P (PCRE2 JIT matching) "\w" regex pattern #241
Comments
I'll work on this. I verified this on a MacOS 12.5.1 M1 Pro and I get the same problem with the command |
I had to divert my attention to another project first, thank you for your patience. After debugging the issue with
Without JIT everything works fine. To verify this, I tested this code that does the same thing to match the input with PCRE2, but without JIT:
Is this a bug in PCRE2 JIT perhaps when running on an M1? It certainly looks that way. This needs further investigation to find out. |
A simplified test case with only -P perl matching with PCRE2:
This fails with
|
Thanks for your patience. I normally address problems right away, but wasn't able to do this time due to several other important obligations. After more testing, I am now convinced this is a problem with PCRE2 for this specific regex pattern when matching a binary file. When the regex pattern is compiled with I will create a POC by isolating the problem in a few lines of C++ code to submit to the PCRE2 folks for them to analyze and fix. There isn't much else I can do on my end. |
I've reported this JIT issue: PCRE2Project/pcre2#180 |
Hardware:
Apple MacBook Pro 16in, 2021
Chip Apple M1 Pro
Memory 16GB
macOS Ventura 13.0.1
Description of issue:
Using the default compression from macOS, I created a zip folder of a javascript application which contains PNG and ICO files. Ugrep throws a segmentation fault when usig a regex pattern search. When I remove the png files from the archive, the pattern search works correctly. The pattern also works correctly with the ICO files in the archive.
Error:
Execution command with full archive:
ugrep -P -z --zmax=1 -n '[\w-]+@([\w-]+.)+[\w-]+' EventTracke.zip
Error:
[1] 31161 segmentation fault ugrep -P -z --zmax=1 -n '[\w-]+@([\w-]+.)+[\w-]+' EventTracke.zip
Removing the png files from the archive:
ugrep -P -z --zmax=1 -n '[\w-]+@([\w-]+.*)+[\w-]+' EventTracke.zip
output:
{EventTracker/src/CommentCreateForm.js}:7:/// Author: dale@mywork.uk.com
{EventTracker/src/services/comments/index.js}:20:/// Modified By: dale@mywork.uk.com
No Error. Email is found.
The text was updated successfully, but these errors were encountered: