NetBSD Problem Report #45178

From www@NetBSD.org  Mon Jul 25 12:49:16 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id CB28163C70A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 25 Jul 2011 12:49:15 +0000 (UTC)
Message-Id: <20110725124915.31E8F63BAC3@www.NetBSD.org>
Date: Mon, 25 Jul 2011 12:49:15 +0000 (UTC)
From: kanaoka@ann.hi-ho.ne.jp
Reply-To: kanaoka@ann.hi-ho.ne.jp
To: gnats-bugs@NetBSD.org
Subject: quagga-0.99.17: zebra Abort trap
X-Send-Pr-Version: www-1.0

>Number:         45178
>Category:       pkg
>Synopsis:       quagga-0.99.17: zebra Abort trap
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gdt
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 25 12:50:01 +0000 2011
>Closed-Date:    
>Last-Modified:  Sun Dec 30 08:01:42 +0000 2012
>Originator:     Masanori Kanaoka
>Release:        NetBSD-current/i386
>Organization:
>Environment:
NetBSD white.k.vnop.net 5.99.55 NetBSD 5.99.55 (GENERIC) #0: Wed Jul 13 06:07:33 JST 2011  root@white.k.vnop.net:/usr/obj/sys/arch/i386/compile/GENERIC i386

>Description:
quagga-0.99.17 with 5.99.55/i386: zebra Abort trap

quagga-0.99.17 with 5.99.41/i386: zebra work fine.
>How-To-Repeat:
pkgsrc/net/quagga with NetBSD 5.99.55/i386
# make install

setting /usr/pkg/etc/zebra/zebra.conf

# /usr/pkg/sbin/zebra
Abort trap
>Fix:
Workaround:

--- zebra/kernel_socket.c.orig  2011-07-25 21:36:54.000000000 +0900
+++ zebra/kernel_socket.c       2011-07-25 21:37:59.000000000 +0900
@@ -50,7 +50,7 @@
  * matter.
  */
 #define ROUNDUP(a) \
-  ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+  ((a) > 0 ? (1 + (((a) - 1) | (sizeof(uint64_t) - 1))) : sizeof(uint64_t))

 /*
  * Given a pointer (sockaddr or void *), return the number of bytes

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->gdt
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Tue, 26 Jul 2011 00:48:43 +0000
Responsible-Changed-Why:
Over to maintainer.


State-Changed-From-To: open->feedback
State-Changed-By: gdt@NetBSD.org
State-Changed-When: Thu, 14 Jun 2012 12:50:53 +0000
State-Changed-Why:
This is an upstream bug, not a packaging bug.  Please file a bug upstream.


From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
To: gnats-bugs@NetBSD.org, gdt@NetBSD.org
Cc: pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/45178 (quagga-0.99.17: zebra Abort trap)
Date: Thu, 21 Jun 2012 21:57:33 +0900 (JST)

 Hi,

 You think so, Would you please Close PR?

        From: gdt@NetBSD.org
     Subject: Re: pkg/45178 (quagga-0.99.17: zebra Abort trap)
       Date : Thu, 14 Jun 2012 12:50:54 +0000 (UTC)
  Message-ID: <20120614125054.AEF5163B882@www.NetBSD.org>

 $ Synopsis: quagga-0.99.17: zebra Abort trap
 $ 
 $ State-Changed-From-To: open->feedback
 $ State-Changed-By: gdt@NetBSD.org
 $ State-Changed-When: Thu, 14 Jun 2012 12:50:53 +0000
 $ State-Changed-Why:
 $ This is an upstream bug, not a packaging bug.  Please file a bug upstream.


 I don't think so.
 I send you next patch at Date: Thu, 28 Jul 2011 22:13:37 +0900 (JST).

 Regards!
 ---
  Masanori Kanaoka        kanaoka AT ann.hi-ho.ne.jp



 --- lib/zebra.h.org	2011-07-28 21:49:00.000000000 +0900
 +++ lib/zebra.h	2011-07-28 21:51:29.000000000 +0900
 @@ -365,6 +365,9 @@
  #define HAVE_IP_HDRINCL_BSD_ORDER
  #endif

 +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 599004500)
 +#define HAVE_RT_ROUNDUP_MACRO
 +#endif
  /* Define BYTE_ORDER, if not defined. Useful for compiler conditional
   * code, rather than preprocessor conditional.
   * Not all the world has this BSD define.
 --- zebra/kernel_socket.c.orig	2011-07-28 21:52:04.000000000 +0900
 +++ zebra/kernel_socket.c	2011-07-28 21:55:02.000000000 +0900
 @@ -41,6 +41,13 @@
  extern struct zebra_privs_t zserv_privs;
  extern struct zebra_t zebrad;

 +#ifdef HAVE_RT_ROUNDUP_MACRO
 +/*
 + * Given a sockaddr length, use RT_ROUNDUP() in <net/route.h>.
 + *
 + */
 +#define ROUNDUP(a)  RT_ROUNDUP(a)
 +#else
  /*
   * Given a sockaddr length, round it up to include pad bytes following
   * it.  Assumes the kernel pads to sizeof(long).
 @@ -51,7 +58,7 @@
   */
  #define ROUNDUP(a) \
    ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
 -
 +#endif /* HAVE_RT_ROUNDUP_MACRO */
  /*
   * Given a pointer (sockaddr or void *), return the number of bytes
   * taken up by the sockaddr and any padding needed for alignment.

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 30 Dec 2012 08:01:42 +0000
State-Changed-Why:
feedback received
(please do file a bug report upstream though)


>Unformatted:

 The patch isn't conditional on how the OS behaves, and thus can't be
 applied.  Further, it should first be submitted upstream, since this
 isn't a packaging problem.  Also, it doesn't have a comment explaining
 why it's right, and I don't even know where the proper padding
 behavior is documented.  Perhaps the problem is really that quagga
 should not be defining ROUNDUP, and instead using RT_ROUNDUP from
 net/route.h.  It looks like ROUNDUP was copied from there anyway.

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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.