NetBSD Problem Report #53978

From gson@gson.org  Thu Feb 14 13:52:33 2019
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0B9097A16A
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 14 Feb 2019 13:52:32 +0000 (UTC)
Message-Id: <20190214135226.E7A3F9892F2@guava.gson.org>
Date: Thu, 14 Feb 2019 15:52:26 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: xentools411 does not build on NetBSD-current
X-Send-Pr-Version: 3.95

>Number:         53978
>Category:       pkg
>Synopsis:       xentools411 does not build on NetBSD-current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gutteridge
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 14 13:55:00 +0000 2019
>Closed-Date:    Mon Feb 25 20:43:25 +0000 2019
>Last-Modified:  Mon Feb 25 20:43:25 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2019.02.14.08.18.26
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

Building xentools411 from pkgsrc on NetBSD-current fails.
The end of the build log looks like this:

  In file included from /usr/include/stdio.h:597:0,
                   from xenpmd.c:35:
  xenpmd.c: In function 'get_next_battery_file':
  xenpmd.c:90:36: error: '%s' directive output may be truncated writing up to 511 bytes into a region of size 271 [-Werror=format-truncation=]
       #define BATTERY_INFO_FILE_PATH "/tmp/battery/%s/info"
                                      ^
  xenpmd.c:113:52: note: in expansion of macro 'BATTERY_INFO_FILE_PATH'
               snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
                                                      ^~~~~~~~~~~~~~~~~~~~~~
  xenpmd.c:113:13: note: '__builtin_snprintf' output between 19 and 530 bytes into a destination of size 284
               snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
               ^
  xenpmd.c:91:37: error: '%s' directive output may be truncated writing up to 511 bytes into a region of size 271 [-Werror=format-truncation=]
       #define BATTERY_STATE_FILE_PATH "/tmp/battery/%s/state"
                                       ^
  xenpmd.c:116:52: note: in expansion of macro 'BATTERY_STATE_FILE_PATH'
               snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
                                                      ^~~~~~~~~~~~~~~~~~~~~~~
  xenpmd.c:116:13: note: '__builtin_snprintf' output between 20 and 531 bytes into a destination of size 284
               snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
               ^
  cc1: all warnings being treated as errors
  gmake[3]: *** [/tmp/sysutils/xentools411/work/xen-4.11.0/tools/xenpmd/../../tools/Rules.mk:225: xenpmd.o] Error 1
  gmake[3]: Leaving directory '/tmp/sysutils/xentools411/work/xen-4.11.0/tools/xenpmd'
  gmake[2]: *** [/tmp/sysutils/xentools411/work/xen-4.11.0/tools/../tools/Rules.mk:249: subdir-all-xenpmd] Error 2
  gmake[2]: Leaving directory '/tmp/sysutils/xentools411/work/xen-4.11.0/tools'
  gmake[1]: *** [/tmp/sysutils/xentools411/work/xen-4.11.0/tools/../tools/Rules.mk:244: subdirs-all] Error 2
  gmake[1]: Leaving directory '/tmp/sysutils/xentools411/work/xen-4.11.0/tools'
  gmake: *** [Makefile:59: build-tools] Error 2
  *** Error code 2

  Stop.
  make[1]: stopped in /usr/pkgsrc/sysutils/xentools411
  WARNING: *** Please consider adding c++ to USE_LANGUAGES in the package Makefile.
  *** Error code 1

  Stop.
  make: stopped in /usr/pkgsrc/sysutils/xentools411

The 8.0 binary package can be used as a work-around.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "David H. Gutteridge" <gutteridge@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53978 CVS commit: pkgsrc/sysutils/xentools411
Date: Mon, 25 Feb 2019 08:19:22 +0000

 Module Name:	pkgsrc
 Committed By:	gutteridge
 Date:		Mon Feb 25 08:19:22 UTC 2019

 Modified Files:
 	pkgsrc/sysutils/xentools411: distinfo
 Added Files:
 	pkgsrc/sysutils/xentools411/patches: patch-tools_xenpmd_xenpmd.c

 Log Message:
 xentools411: address build failure with GCC >= 7

 Address PR pkg/53978: newer versions of GCC have a format-truncation
 error triggered. Increase the size of a string to work around this.
 (This may need more attention upstream.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/xentools411/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/sysutils/xentools411/patches/patch-tools_xenpmd_xenpmd.c

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

Responsible-Changed-From-To: pkg-manager->gutteridge
Responsible-Changed-By: gutteridge@NetBSD.org
Responsible-Changed-When: Mon, 25 Feb 2019 08:23:38 +0000
Responsible-Changed-Why:
Take, since I just pushed a patch.


State-Changed-From-To: open->feedback
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Mon, 25 Feb 2019 08:24:47 +0000
State-Changed-Why:
Please confirm if this is a satisfactory fix?

State-Changed-From-To: feedback->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Mon, 25 Feb 2019 20:43:25 +0000
State-Changed-Why:
The fix by gutteridge works for me - thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.