Source: glib2.0
Version: 2.46.2-1
Severity: serious
Tags: upstream patch
Justification: fails to build from source (but built successfully in the past)
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=759808

GLib 2.46.2-2 FTBFS with a regex test failure on all release architectures
except amd64, where it was built by the maintainer. The same test is also
now failing with the prebuilt 2.46.2-1 on ci.debian.net, so this is not
actually a regression in 2.46.2-2; instead, it's a regression in the new
libpcre3.

The problem appears to be that certain invalid regexes are diagnosed
differently (different error code) with PCRE 8.38.
I have sent a report and patch to GNOME (also attached),
<https://bugzilla.gnome.org/show_bug.cgi?id=759808>

X-Debbugs-Cc set to libpc...@packages.debian.org. Matthew, it would be
great if you could upload new pcre3 versions to experimental initially,
and/or run the GLib regex test against them before uploading to unstable
(install libglib2.0-tests and run
"/usr/lib/glib2.0/installed-tests/glib/regex" - no special options are
needed, and it will exit 0 for success or nonzero for failure).

Regards,
    S
>From 414259817e646b8c33907e7ddb3971008a2bc17f Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Wed, 23 Dec 2015 15:03:16 +0000
Subject: [PATCH] regex test: expect ASSERTION_EXPECTED for /(?(?<ab))/ with
 PCRE 8.38

PCRE 8.38 changed the parsing of this invalid regex. It still fails,
but with a different error (since PCRE r1539,
<http://vcs.pcre.org/pcre?view=revision&revision=1539>).

The regex /(?P<sub>foo)\g<sub/ used to raise MISSING_BACK_REFERENCE but
now raises MISSING_SUBPATTERN_NAME_TERMINATOR, so we can still have a
test for the latter.

Signed-off-by: Simon McVittie <s...@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=759808
---
 glib/tests/regex.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/glib/tests/regex.c b/glib/tests/regex.c
index 09083a3..777616a 100644
--- a/glib/tests/regex.c
+++ b/glib/tests/regex.c
@@ -2261,7 +2261,14 @@ main (int argc, char *argv[])
   TEST_NEW_FAIL ("^(?(0)f|b)oo", 0, G_REGEX_ERROR_INVALID_CONDITION);
   TEST_NEW_FAIL ("(?<=\\C)X", 0, G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND);
   TEST_NEW_FAIL ("(?!\\w)(?R)", 0, G_REGEX_ERROR_INFINITE_LOOP);
+#if PCRE_MAJOR > 8 || (PCRE_MAJOR == 8 && PCRE_MINOR >= 38)
+  /* The expected errors changed here. */
+  TEST_NEW_FAIL ("(?P<sub>foo)\\g<sub", 0, G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR);
+  TEST_NEW_FAIL ("(?(?<ab))", 0, G_REGEX_ERROR_ASSERTION_EXPECTED);
+#else
+  TEST_NEW_FAIL ("(?P<sub>foo)\\g<sub", 0, G_REGEX_ERROR_MISSING_BACK_REFERENCE);
   TEST_NEW_FAIL ("(?(?<ab))", 0, G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR);
+#endif
   TEST_NEW_FAIL ("(?P<x>eks)(?P<x>eccs)", 0, G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME);
 #if 0
   TEST_NEW_FAIL (?, 0, G_REGEX_ERROR_MALFORMED_PROPERTY);
-- 
2.6.4

Reply via email to