NetBSD Problem Report #49557

From he@smistad.uninett.no  Mon Jan 12 09:58:04 2015
Return-Path: <he@smistad.uninett.no>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id DE211A57FE
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 12 Jan 2015 09:58:04 +0000 (UTC)
Message-Id: <20150112095757.8DD823D0A8@smistad.uninett.no>
Date: Mon, 12 Jan 2015 10:57:57 +0100 (CET)
From: he@nordu.net
Reply-To: he@nordu.net
To: gnats-bugs@gnats.NetBSD.org
Subject: rrdtool-1.4.9 fails to work with glib2+pcre
X-Send-Pr-Version: 3.95

>Number:         49557
>Category:       pkg
>Synopsis:       rrdtool-1.4.9 fails to work with glib2+pcre
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 12 10:00:00 +0000 2015
>Closed-Date:    Tue Aug 18 12:37:41 +0000 2015
>Last-Modified:  Tue Aug 18 12:37:41 +0000 2015
>Originator:     Havard Eidnes
>Release:        NetBSD 6.1.5
>Organization:
	NORDUnet
>Environment:
System: NetBSD stats3.nordu.net 6.1.5 NetBSD 6.1.5 (SD_VMT_TWEAK) #0: Tue Oct 21 14:11:39 CEST 2014  root@stats3.nordu.net:/usr/obj/sys/arch/i386/compile/SD_VMT_TWEAK i386
Architecture: i386
Machine: i386
>Description:
	Upgrading just rrdtool from version 1.4.8 to 1.4.9 causes it
	to no longer work.  The error symptom is that glib2 emits this
	warning:

(process:8319): GLib-CRITICAL **: PCRE library is compiled without UTF8 support

(process:8319): GLib-CRITICAL **: PCRE library is compiled without UTF8 properties support

	and rrdtool itself emits an error message saying

Error making RRD graph: cannot compile regular expression: PCRE library is compiled with incompatible options (^(?:[^%]+|%%)*%[-+ 0#]?[0-9]*(?:[.][0-9]+)?l[eEfFgG](?:[^%]+|%%)*(?:%s)?(?:[^%]+|%%)*$)

	This is some of the new checking code in rrdtool which calls
	into glib2 for regexp matching.  The strange thing is that if
	I make a tiny test program to try to replicate the error:

--------------------
#include <stdio.h>
#include <glib.h>

#define PATTERN "(^(?:[^%]+|%%)*%[-+ 0#]?[0-9]*(?:[.][0-9]+)?l[eEfFgG](?:[^%]+|%%)*(?:%s)?(?:[^%]+|%%)*$)"

int
main(int argc, char **argv)
{
        GRegex *re;
        GError *err;

        err = NULL;
        re = g_regex_new(PATTERN, G_REGEX_EXTENDED, 0, &err);
        if (err != NULL) {
                printf("Cannot compile RE: %s\n", err->message);
        }
        if (re == NULL) {
                printf("g_regex_new() returned NULL\n");
        }

        return 0;
}
--------------------

	and build and run this with

	-I /usr/pkg/include
	-I /usr/pkg/include/glib2/glib-2.0
	-I /usr/pkg/lib/glib-2.0/include

	and link with

	-R /usr/pkg/lib
	-L /usr/pkg/lib
	-lglib-2.0 -lpcre

	and run the result, nothing happens, as in no error message is
	emitted.

	I've traced the origin of the glib2 error messages above to
	glib2's glib/gregex.c's g_regex_new(), which is also called by
	the test program above.

	I must admit that at this point I don't understand what is
	going on, and why g_regex_new() fails when called from rrdtool
	but succeeds when called from my tiny test program.


>How-To-Repeat:
	Install rrdtool-1.4.9, watch it fail.

>Fix:
	Sorry, don't know.	

>Release-Note:

>Audit-Trail:
From: Havard Eidnes <he@uninett.no>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49557 rrdtool-1.4.9 fails to work with glib2+pcre
Date: Sat, 15 Aug 2015 08:17:18 +0200 (CEST)

 Hi,

 some more information related to this issue:

 The error appears to only occur when the "rrdtool graph" function is
 invoked via the perl module RRDs and when embedded in an apache web
 server, with an embedded perl interpreter.

 A plain command with "rrdtool graph <args>" where the args are
 as specified by the web server script results in no error.

 Also, a simple perl script replicating what the web server does using
 RRDs::graph() with the same args also does not return any error.

 I've looked in /usr/pkg for files containing the string pcre_config,
 but did not find any occurrances which would indicate there's a symbol
 conflict for that name.

 Some of the changes introduced between rrdtool 1.4.8 and 1.4.9 is that
 a homebrew and possibly incomplete regexp matcher was replaced with
 use of the glib2 regexp wrapper functions using pcre (g_regex_new() /
 g_regex_match()).  When embedded as described above, these calls fail,
 while they succeed when run either standalone (via rrdtool) or under a
 non-apache-embedded perl.

 Hints for further debugging welcome.

 Regards,

 - H=E5vard

From: Makoto Fujiwara <makoto@ki.nu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49557 rrdtool-1.4.9 fails to work with glib2+pcre
Date: Sun, 16 Aug 2015 23:29:30 +0900

 Just a side note, I've packaged rrdtool-1.5.4 at wip.
 Please add it as a candidate for the test, thanks.
 ---
 mef@NetBSD.org
 Makoto Fujiwara, 
 http://www.ki.nu/~makoto/pkgsrc/check-update/00_Summary.html

From: Havard Eidnes <he@nordu.net>
To: makoto@ki.nu
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/49557 rrdtool-1.4.9 fails to work with glib2+pcre
Date: Sun, 16 Aug 2015 18:27:53 +0200 (CEST)

 >  Just a side note, I've packaged rrdtool-1.5.4 at wip.
 >  Please add it as a candidate for the test, thanks.

 Thanks!

 I'll also note that in my testing I've upgraded some of the web
 servers from apache 2.2.x to apache 2.4.x, and with 2.4.x the
 problem does not appear to be reproducible.

 Regards,

 - H=E5vard

From: "Makoto Fujiwara" <mef@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49557 CVS commit: pkgsrc/databases/rrdtool
Date: Tue, 18 Aug 2015 12:29:44 +0000

 Module Name:	pkgsrc
 Committed By:	mef
 Date:		Tue Aug 18 12:29:44 UTC 2015

 Modified Files:
 	pkgsrc/databases/rrdtool: Makefile PLIST distinfo
 	pkgsrc/databases/rrdtool/patches: patch-al
 	    patch-bindings_perl-shared_Makefile.PL

 Log Message:
 (pkgsrc)
  - Fix PR pkg/49557 (by updating 1.4.9 to 1.5.4)
  - Add including lang/python/application.mk (for REPLACE_PYTHON)
  - Assign empty value to TEST_TARGET, to avoid
    *** No rule to make target 'test' (when PKGSRC_RUN_TEST=yes is set)
 (upstream)
  - Update 1.4.9 to 1.5.4
 -------------------------
 RRDtool 1.5.4 - 2015-08-09
 ==========================
 Bug Fixes
 ---------
 * parse floating point numbers according to C locale in rrdtool create
   arguments, regardless of the systems locale setting.
 * include missing rrd_rados.h into distribution archive
 * make rrdtool work on ARM again
 * make rrdtool test suit pass on 32bit OSs
 * fix --grid-dash option regression in graph
 * fix systemd support
 * fix link dependency for libpng since we are using functions directly
 * fix python module name
 * fix rrdtool tune to accept U in minimum and maximum options
 * fi
 * rrd_parsetime now uses a mutex lock to become thread safe
 * rrd_xport is now thread safe
 * stop using MAX_PATH and make everything dynamic and make rrdtool work on
   Gnu HURD ... thanks nirgal!

 Features
 --------
 * new RPN operators: STEPWIDTH, NEWDAY, NEWWEEK, NEWMONTH and NEWWEEK
   together they allow to draw graphs where a rate is converted back to
   absolute numbers and accumulated over a period..

 RRDtool 1.5.3 - 2015-04-30
 ==========================
 Bug Fixes
 ---------
 * Brought commmand-line options and documentation back into sync.
 * Make LINE dashes option work again

 RRDtool 1.5.2 - 2015-04-23
 ==========================
 Bug Fixes
 ---------
 * paramters in VDEF are vnames and not data source names, hence
   they can be 255 chars long and not only 20

 RRDtool 1.5.1 - 2015-04-22
 ==========================
 Bug Fixes
 ---------
 * parse numbers up to 40 characters long ..
 * fix install rules for Python and Lua
 * include missing VERSION and LICENSE file
 * unlink before rename in rrd_create when running on WIN32

 RRDtool 1.5.0 - 2015-04-16
 ==========================

 New Features
 ------------
 * automatic x-axis labels that work from 1s to 30y on a single chart
 * librados integration
 * new datasource types: DCOUNTER and DDERIVE (they work the same as the
   original DS, except that they can deal with floatingpoint numbers).
 * compile without graphics libraries: ./configure --disable-rrd_graph
 * updated windows port (see WIN32-BUILD-TIPS.txt)
 * single step RRAs for MIN,MAX,LAST are generated virtually from
   an AVERAGE RRA
 * ignore updates in the past with rrdtool update --skip-past-updates
 * ignore a LINE when scaling a chart using the skipscale option
 * detect 32bit timeoverflows
 * massive performance boost for charts with more than 100 DEF line by
   switching form a linear search to a HASH when searching for data
 * improved cross compilation support
 * .Net bindings
 * allow rrdtool graph to silently skip non-existing source files using the
   --use-nan-for-all-missing-data option
 * restore from a pipe (rrdtool restore - y.rrd)
 * in rrdtool create, row count and step can be defined in absolute time
 * all new "create on steroids" can pull both data and configuration from
   existing rrd files
 * use rrdtool graph to chart arbitrary data via a callback function for data fetching
   support is integrated in the perl bindings.
 * re-written parser for rrdtool graph commands. It now follows a simple key
   value pattern, compatible with the previous syntax.
 * MEDIAN op for CDEF expressions
 * DEPTH,INDEX,COPY,ROL ops for CDEF (as seen in PostScript)
 * gradient AREA backgrounds
 * no more locale magic while reading numeric data.

 Bugfixes
 --------
 all the bugs fixed in 1.4.x during 1.5 development


 To generate a diff of this commit:
 cvs rdiff -u -r1.118 -r1.119 pkgsrc/databases/rrdtool/Makefile
 cvs rdiff -u -r1.14 -r1.15 pkgsrc/databases/rrdtool/PLIST
 cvs rdiff -u -r1.46 -r1.47 pkgsrc/databases/rrdtool/distinfo
 cvs rdiff -u -r1.17 -r1.18 pkgsrc/databases/rrdtool/patches/patch-al
 cvs rdiff -u -r1.1 -r1.2 \
     pkgsrc/databases/rrdtool/patches/patch-bindings_perl-shared_Makefile.PL

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: mef@NetBSD.org
State-Changed-When: Tue, 18 Aug 2015 12:37:41 +0000
State-Changed-Why:
The originator confirmed the problem no longer reproducable with version 1.5.4
Thanks reporting and testing the problem.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.