Bug#636132: libsignatures-perl: FTBFS with perl 5.14: Failed test 'signatures parse in eval'

Colin Watson cjwatson at ubuntu.com
Sun Apr 22 17:43:11 UTC 2012


tags 636132 patch
user ubuntu-devel at lists.ubuntu.com
usertags 636132 ubuntu-patch precise
thanks

On Sat, Aug 20, 2011 at 06:47:12PM +0100, Dominic Hargreaves wrote:
> On Sun, Jul 31, 2011 at 01:24:54PM +0100, Dominic Hargreaves wrote:
> > This package FTBFS with perl 5.14:
> > 
> > #   Failed test 'signatures parse in eval'
> > #   at t/eval.t line 8.
> > # forced to realloc PL_linestr for line use signatures;sub foo ($bar) { $bar }
> > # ;, bailing out before we crash harder at /build/dom-libsignatures-perl_0.05-1+b2-i386-TwSmvh/libsignatures-perl-0.05/blib/lib/signatures.pm line 87.
> > Undefined subroutine &main::foo called at t/eval.t line 11.
> > # Looks like you planned 8 tests but ran 2.
> > # Looks like you failed 1 test of 2 run.
> > # Looks like your test exited with 255 just after 2.
> > 
> > This is
> > <https://rt.cpan.org/Public/Bug/Display.html?id=66997>
> 
> There seems to be no fix upstream at the moment.

I just sent a patch upstream based on what libdevel-declare-perl does.
Here's a copy which I think should be suitable for upload:

  * With Perl >= 5.13.6, reallocate PL_linestr in a block hook to avoid
    reallocations; borrowed loosely from Devel::Declare (closes: #636132).

--- libsignatures-perl-0.05.orig/signatures.xs
+++ libsignatures-perl-0.05/signatures.xs
@@ -241,6 +241,16 @@
 	return ret;
 }
 
+#if PERL_BCDVERSION >= 0x5013006
+STATIC void
+block_start (pTHX_ int full) {
+	PERL_UNUSED_VAR (full);
+
+	if (SvLEN (PL_linestr) < 16384)
+		lex_grow_linestr (16384);
+}
+#endif
+
 STATIC OP *
 before_eval (pTHX_ OP *op, void *user_data) {
 	dSP;
@@ -293,12 +303,19 @@
 		char *f_class
 	PREINIT:
 		userdata_t *ud;
+#if PERL_BCDVERSION >= 0x5013006
+		static BHK bhk;
+#endif
 	INIT:
 		Newx (ud, 1, userdata_t);
 		ud->class = newSVsv (class);
 		ud->f_class = f_class;
 	CODE:
 		ud->parser_id = hook_parser_setup ();
+#if PERL_BCDVERSION >= 0x5013006
+		BhkENTRY_set (&bhk, bhk_start, block_start);
+		Perl_blockhook_register (aTHX_ &bhk);
+#endif
 		ud->eval_hook = hook_op_check (OP_ENTEREVAL, handle_eval, ud);
 		RETVAL = (UV)hook_op_check (OP_CONST, handle_proto, ud);
 	OUTPUT:

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the pkg-perl-maintainers mailing list