-
Notifications
You must be signed in to change notification settings - Fork 561
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
Segfault in Perl_re_op_compile at regcomp.c:8488 #17775
Comments
At an initial look, it appears the chunk at regcomp.c:16465 isn't working as intended - it is relying on the documented return value of reg() (same as regbranch()):
.. but stepping through regbranch(), it appears that it actually returns the offset of the first node it has emitted - which in this case is probably always 1. The size of the extended charclass node appears to be 4, and the patch below appears to now give the intended error instead of a core:
@khwilliamson please take a look whether this looks sane. I'll try to dig into the history of the discrepancy between documentation and reality for the return values of reg() and regbranch().
|
@hvds I placed your patch in a smoke-me branch, smoke-me/jkeenan/hvds/gh-17775. While it's PASSing and FAILing on our smoke-testers in the normal places, it's FAILing on two of our github actions. See: I do not know how reliable these github actions setups are, so I can't say whether they are the basis for rejecting your patch. Can you take a look? Thank you very much. |
These are definitely test failures caused by the patch:
I'll take a look. |
The regex_sets failure is:
.. and this appears to be because the size of the extended charclass op is 2 on 32-bit, not 4. To fix that I'll need to work out how to ask the size of it properly, unless @khwilliamson already knows. The two failures in reg_mesg.t are probably occurring for the same reason: the regexp introduced as a test for #16649 now fails with "Expecting interpolated extended charclass" instead of the expected message. |
It will take me a few minutes to get the code to do the size properly. |
I replaced that smoke test with one that should work on 32 bit systems, using the standard way to find the size of a node I'm thinking for 5.33 that this paradigm is used in enough places that there should be a macro, say, NODE_EQUIVALENTS(node) that encapsulates it. |
It looks like that part of the documentation was already wrong when first added as part of f55b7b2. I think what both these functions actually now return is the offset of a newly inserted node that either needs its 'next' pointer updated to point to whatever will get added next, or starts a chain whose 'next' pointers can be followed to find such a node - it appears the primary use (other than as a success marker) is to pass into a subsequent REGTAIL call. |
I'm not sure where we are on this. |
Assuming smokes are clean, we should go with Karl's patch - @khwilliamson, @jkeenan? |
On 5/20/20 10:05 PM, Hugo van der Sanden wrote:
I'm not sure where we are on this.
Assuming smokes are clean, we should go with Karl's patch -
@khwilliamson <https://github.com/khwilliamson>, @jkeenan
<https://github.com/jkeenan>?
The smoke-test failures being reported on the branch are also failing in
blead, so they form no impediment to merging to blead. The actual
content of the patch is beyond my expertise.
Thank you very much.
Jim Keenan
|
@khwilliamson thoughts? |
I'm fine with taking my revision to @hvds patch |
I made a comment on the commit. There seems to be an |
Resolved. Thanks, everyone. 👍 |
This is a bug report for perl from sergey.aleynikov@gmail.com,
generated with the help of perlbug 1.41 running under perl 5.31.10.
[Please describe your issue here]
While fuzzing perl v5.31.9-70-g0c96aa4b7b built with afl and run
under libdislocator, I found the following program
to cause a segfault. GDB stack trace is:
This is a regression in blead, bisect points to d8d1ded is the first bad commit
The text was updated successfully, but these errors were encountered: