-
Notifications
You must be signed in to change notification settings - Fork 1.6k
make test crash when using pcre jit #23
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
Comments
Hello Rainer, I cannot reproduce this issue. Could you tell me what pcre version and linux distro you are using ? |
Can you try replace the *errmsg in re_operators.c to:
Let me know if it fix the issue |
PCRE Version: PCRE 8.32 OS:
all with custom build Apache Of course it only happens with "--enable-pcre-jit". Full configure line: ./configure Will test your suggested patch and report back. |
Yes, your patch fixes the test failures for me on all platforms. Note that the same test against NULL but not against NOT_SET_P happens in 9 places in re_operators.c. Not sure whether the test against NOT_SET_P is needed in all those places. Some similar checks occur in re.c. The file apache2_config.c seems OK to me. |
Fixed |
make test crashes with a segfault if configure was run with pcre jit enabled.
Crash happens in rx.t, e.g. in
./msc_test "-t" "op" "-n" "rx" "-p" "" "-D" "0" "-r" "1"
Stack shows that the problem is in apache2/re_operators.c:
1000 *error_msg = apr_psprintf(rule->ruleset->mp,
1001 "Rule %pp [id "%s"][file "%s"][line "%d"] - "
1002 "Execution error - "
1003 "Does not support JIT (%d)",
1004 rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
1005 rule->filename != NULL ? rule->filename : "-",
1006 rule->line_num,rc);
1007 }
The rule used here has non-null actionset, but the id is set to 0xffffffff which can't be printed with %s.
The crash can be avoided by e.g. the following patch to tests/msc_test.c:
--- msc_test.c 2012-12-29 20:22:37.515480000 +0100
+++ msc_test.c 2012-12-29 20:23:32.392925000 +0100
@@ -325,9 +325,6 @@
*errmsg = apr_psprintf(g_mp, "Failed to create rule for op "%s": %s", name, *errmsg);
return -1;
}
/* Create a fake variable */
data->var = (msre_var *)apr_pcalloc(g_mp, sizeof(msre_var));
Note that I don't know why the test entered the error path in line 999 above. It shouldn't crash though.
The text was updated successfully, but these errors were encountered: