-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
SIGSEGV in libpcre2 on PHP 8.1 (ARM) #1721
Comments
If you can get a coredump from the pcre2, Philip (pcre author) is usually very responsive and helpful. |
The pcre2 has been updated to 10.40, could you perhaps try now? |
I have another stability issue I need to sort out first, but as soon as I'm sure everything is stable with JIT disabled, I'll give it another shot. |
Same issue. |
Hi, I am running into the same problem on our server with php8.1 and libpcre2. Here is the latest crash report, I will try to find the problem but help is appreciated :) (gdb) bt full It does not happen all the time but every few thousand requests. Our site is used enough though that it happens every hour or so. It is also always the same piece of code: const PATH_PATTERN_SEARCH_JSON = '#(DOMAIN_PLACEHOLDER)([a-z]+)([_A-Z])(-[-_a-z0-9]+).json$#i'; Is that something that can help you? Best |
Hi, #0 vld1q_u8 (__a=0xffff88600000 <error: Cannot access memory at address 0xffff88600000>) at /usr/lib/gcc/aarch64-linux-gnu/11/include/arm_neon.h:16131
No locals.
#1 ffcps_default (str_end=0xffff885ffffe "", str_ptr=0xffff88600000 <error: Cannot access memory at address 0xffff88600000>, offs1=2, offs2=<optimized out>, chars=<optimized out>)
at src/pcre2_jit_neon_inc.h:190
qw = {mem = "\240o\300ݪ\252\000\000 LA\215\377\377\000", dw = {187650841538464, 281473051610144}}
ic = <optimized out> it is referencing same file and line src/pcre2_jit_neon_inc.h:190. That is fixed in libpcre2 10.42 (Changelog: 5. Merged @carenas patch #175 which fixes #86 - segfault on aarch64 (ARM),) |
Debugging this was a PITA, so I'd love to see it shipped :) In the meantime, you can disable PCRE JIT as a workaround. I haven't found it to affect performance much in most PHP use cases. |
FWIW it shipped with 10.42, and it is small enough that it would make sense to backport, if upgrading the whole PCRE library is not an option. |
I know it is kind of redudant/obvious but want to mention that same lib version is utilized for php 8.3.x so issue continue :) |
ONLY if you use a version of PHP that uses the embedded PCRE2 and that hasn't been updated, unless you are talking of a different issue that "might" look similar. there is at least another crasher in the ARM code that was ALSO fixed in the recent 10.43RC1 and that EVERYONE should be running instead (either as part of PHP or as an independent library) FWIW if you need to keep using older PCRE for whatever reason, backporting the known crashers is the least that should be expected from a packaged PHP IMHO, let me know if I can help. |
there is new ondrej provided: |
Frequently asked questions
Describe the bug
I've noticed an unusual number of segfaults since upgrading from PHP 8.0 to PHP 8.1. They're rare enough that I haven't had any luck making a reliable repro, but they're frequent enough to cause problems.
Coredumps indicate that the issue is probably related to PCRE JIT:
To Reproduce
Sorry, I don't have a reliable repro--it's been difficult to narrow down the cause. It's happening seemingly with any request handled by PHP-FPM, but very infrequently--maybe every thousand requests or so. There isn't any obvious correlation between the requests that segfault, other than that they probably all use preg_* functions at one point or another.
This is something that I can likely debug and even patch on my own, but I'm having trouble since it's difficult to reproduce. If anyone has any ideas that could lead to a more reliable repro, or even better debugging methods than simply throwing a coredump at gdb, that would be greatly appreciated.
Expected behavior
No segfaults
Distribution (please complete the following information):
Package(s) (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: