Skip to content
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

Bleadperl v5.19.0-339-g52a21eb breaks DGL/re-engine-RE2-0.11.tar.gz #13834

Closed
p5pRT opened this issue May 14, 2014 · 7 comments
Closed

Bleadperl v5.19.0-339-g52a21eb breaks DGL/re-engine-RE2-0.11.tar.gz #13834

p5pRT opened this issue May 14, 2014 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented May 14, 2014

Migrated from rt.perl.org#121868 (status was 'resolved')

Searchable as RT121868$

@p5pRT
Copy link
Author

p5pRT commented May 14, 2014

From @andk

git bisect


commit 52a21eb
Author​: David Mitchell <davem@​iabyn.com>
Date​: Sat May 18 15​:05​:57 2013 +0100

  add strbeg argument to Perl_re_intuit_start()

diagnostics


http​://www.cpantesters.org/cpan/report/2c5513f4-cd69-11e3-86a8-5ce66dfca90a

ticket in rt.cpan


https://rt.cpan.org/Ticket/Display.html?id=95144

perl -V


see diagnostics

--
andreas

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @tonycoz

On Tue May 13 20​:07​:18 2014, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

git bisect
----------
commit 52a21eb
Author​: David Mitchell <davem@​iabyn.com>
Date​: Sat May 18 15​:05​:57 2013 +0100

add strbeg argument to Perl\_re\_intuit\_start\(\)

diagnostics
-----------
http​://www.cpantesters.org/cpan/report/2c5513f4-cd69-11e3-86a8-5ce66dfca90a

ticket in rt.cpan
-----------------
https://rt.cpan.org/Ticket/Display.html?id=95144

perl -V
-------
see diagnostics

This was broken by a documented change to the regular expression API​:

=item *

The signature of the C<Perl_re_intuit_start()> regex function has changed;
the function pointer C<intuit> in the regex engine plugin structure
has also changed accordingly. A new parameter, C<strbeg> has been added;
this has the same meaning as the same-named parameter in
C<Perl_regexec_flags>. Previously intuit would try to guess the start of
the string from the passed SV (if any), and would sometimes get it wrong
(e.g. with an overloaded SV).

Unfortunately it was also broken by a more vaguely documented change​:

The regular expression engine now supports strings longer than 2**31
characters. [perl #112790, #116907]

I've added​:

=item *

The signature of the C<Perl_regexec_flags()> regex function has
changed; the function pointer C<exec> in the regex engine plugin
structure has also changed to match. The C<minend> parameter now has
type C<SSize_t> to better support 64-bit systems.

The attached patch fixes the build for re-engine-RE2 on blead.

Tony

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @tonycoz

re-engine-RE2.patch
diff -ru re-engine-RE2-0.11-orig/re2_xs.cc re-engine-RE2-0.11/re2_xs.cc
--- re-engine-RE2-0.11-orig/re2_xs.cc	2012-07-29 21:27:10.000000000 +1000
+++ re-engine-RE2-0.11/re2_xs.cc	2014-05-15 13:39:15.000000000 +1000
@@ -30,10 +30,17 @@
             const
 #endif
             SV * const, U32);
+#if PERL_VERSION >= 19
+    char *   RE2_intuit(pTHX_ REGEXP * const, SV *, const char *,
+                        char *, char *, U32, re_scream_pos_data *);
+    I32      RE2_exec(pTHX_ REGEXP * const, char *, char *,
+                      char *, SSize_t, SV *, void *, U32);
+#else
     I32      RE2_exec(pTHX_ REGEXP * const, char *, char *,
                       char *, I32, SV *, void *, U32);
     char *   RE2_intuit(pTHX_ REGEXP * const, SV *, char *,
                         char *, U32, re_scream_pos_data *);
+#endif
     SV *     RE2_checkstr(pTHX_ REGEXP * const);
     void     RE2_free(pTHX_ REGEXP * const);
     SV *     RE2_package(pTHX_ REGEXP * const);
@@ -243,10 +250,17 @@
     return rx_sv;
 }
 
+#if PERL_VERSION >= 19
+I32
+RE2_exec(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
+          char *strbeg, SSize_t minend, SV * sv,
+          void *data, U32 flags)
+#else
 I32
 RE2_exec(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
           char *strbeg, I32 minend, SV * sv,
           void *data, U32 flags)
+#endif
 {
     RE2 * ri = (RE2*) RegSV(rx)->pprivate;
     regexp * re = RegSV(rx);
@@ -291,12 +305,21 @@
     return 1;
 }
 
+#if PERL_VERSION >= 19
+char *
+RE2_intuit(pTHX_ REGEXP * const rx, SV * sv, const char *strbeg, char *strpos,
+             char *strend, U32 flags, re_scream_pos_data *data)
+#else
 char *
 RE2_intuit(pTHX_ REGEXP * const rx, SV * sv, char *strpos,
              char *strend, U32 flags, re_scream_pos_data *data)
+#endif
 {
 	PERL_UNUSED_ARG(rx);
 	PERL_UNUSED_ARG(sv);
+#if PERL_VERSION >= 19
+	PERL_UNUSED_ARG(strbeg);
+#endif
 	PERL_UNUSED_ARG(strpos);
 	PERL_UNUSED_ARG(strend);
 	PERL_UNUSED_ARG(flags);

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @dgl

Thanks for the patch, but it's fixed in re-engine-RE2 git already. Will do
a release before 5.20.
On 15 May 2014 04​:44, "Tony Cook via RT" <perlbug-followup@​perl.org> wrote​:

On Tue May 13 20​:07​:18 2014, andreas.koenig.7os6VVqR@​franz.ak.mind.dewrote​:

git bisect
----------
commit 52a21eb
Author​: David Mitchell <davem@​iabyn.com>
Date​: Sat May 18 15​:05​:57 2013 +0100

add strbeg argument to Perl\_re\_intuit\_start\(\)

diagnostics
-----------

http​://www.cpantesters.org/cpan/report/2c5513f4-cd69-11e3-86a8-5ce66dfca90a

ticket in rt.cpan
-----------------
https://rt.cpan.org/Ticket/Display.html?id=95144

perl -V
-------
see diagnostics

This was broken by a documented change to the regular expression API​:

=item *

The signature of the C<Perl_re_intuit_start()> regex function has changed;
the function pointer C<intuit> in the regex engine plugin structure
has also changed accordingly. A new parameter, C<strbeg> has been added;
this has the same meaning as the same-named parameter in
C<Perl_regexec_flags>. Previously intuit would try to guess the start of
the string from the passed SV (if any), and would sometimes get it wrong
(e.g. with an overloaded SV).

Unfortunately it was also broken by a more vaguely documented change​:

The regular expression engine now supports strings longer than 2**31
characters. [perl #112790, #116907]

I've added​:

=item *

The signature of the C<Perl_regexec_flags()> regex function has
changed; the function pointer C<exec> in the regex engine plugin
structure has also changed to match. The C<minend> parameter now has
type C<SSize_t> to better support 64-bit systems.

The attached patch fixes the build for re-engine-RE2 on blead.

Tony

---
via perlbug​: queue​: perl5 status​: new
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121868

diff -ru re-engine-RE2-0.11-orig/re2_xs.cc re-engine-RE2-0.11/re2_xs.cc
--- re-engine-RE2-0.11-orig/re2_xs.cc 2012-07-29 21​:27​:10.000000000 +1000
+++ re-engine-RE2-0.11/re2_xs.cc 2014-05-15 13​:39​:15.000000000 +1000
@​@​ -30,10 +30,17 @​@​
const
#endif
SV * const, U32);
+#if PERL_VERSION >= 19
+ char * RE2_intuit(pTHX_ REGEXP * const, SV *, const char *,
+ char *, char *, U32, re_scream_pos_data *);
+ I32 RE2_exec(pTHX_ REGEXP * const, char *, char *,
+ char *, SSize_t, SV *, void *, U32);
+#else
I32 RE2_exec(pTHX_ REGEXP * const, char *, char *,
char *, I32, SV *, void *, U32);
char * RE2_intuit(pTHX_ REGEXP * const, SV *, char *,
char *, U32, re_scream_pos_data *);
+#endif
SV * RE2_checkstr(pTHX_ REGEXP * const);
void RE2_free(pTHX_ REGEXP * const);
SV * RE2_package(pTHX_ REGEXP * const);
@​@​ -243,10 +250,17 @​@​
return rx_sv;
}

+#if PERL_VERSION >= 19
+I32
+RE2_exec(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
+ char *strbeg, SSize_t minend, SV * sv,
+ void *data, U32 flags)
+#else
I32
RE2_exec(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
char *strbeg, I32 minend, SV * sv,
void *data, U32 flags)
+#endif
{
RE2 * ri = (RE2*) RegSV(rx)->pprivate;
regexp * re = RegSV(rx);
@​@​ -291,12 +305,21 @​@​
return 1;
}

+#if PERL_VERSION >= 19
+char *
+RE2_intuit(pTHX_ REGEXP * const rx, SV * sv, const char *strbeg, char
*strpos,
+ char *strend, U32 flags, re_scream_pos_data *data)
+#else
char *
RE2_intuit(pTHX_ REGEXP * const rx, SV * sv, char *strpos,
char *strend, U32 flags, re_scream_pos_data *data)
+#endif
{
PERL_UNUSED_ARG(rx);
PERL_UNUSED_ARG(sv);
+#if PERL_VERSION >= 19
+ PERL_UNUSED_ARG(strbeg);
+#endif
PERL_UNUSED_ARG(strpos);
PERL_UNUSED_ARG(strend);
PERL_UNUSED_ARG(flags);

@p5pRT
Copy link
Author

p5pRT commented May 16, 2014

From @rjbs

Since we're not blocked by this, I've resolved it!

David​: RC1 comes out Real Soon. So consider making that pre-5.20.0 release. ;)

--
rjbs

@p5pRT p5pRT closed this as completed May 16, 2014
@p5pRT
Copy link
Author

p5pRT commented May 16, 2014

@rjbs - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant