NetBSD Problem Report #52509

From Manuel.Bouyer@lip6.fr  Mon Aug 28 10:52:16 2017
Return-Path: <Manuel.Bouyer@lip6.fr>
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" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8EC257A1FE
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 28 Aug 2017 10:52:16 +0000 (UTC)
Message-Id: <20170828105212.CA3A9A93A@armandeche.soc.lip6.fr>
Date: Mon, 28 Aug 2017 12:52:12 +0200 (MEST)
From: Manuel.Bouyer@lip6.fr
Reply-To: Manuel.Bouyer@lip6.fr
To: gnats-bugs@NetBSD.org
Subject: c++ exceptions broken on earmv7hf (and maybe all arm)
X-Send-Pr-Version: 3.95

>Number:         52509
>Category:       port-arm
>Synopsis:       c++ exceptions broken on earmv7hf (and maybe all arm)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 28 10:55:00 +0000 2017
>Closed-Date:    Fri Sep 01 16:38:09 +0000 2017
>Last-Modified:  Fri Sep 01 16:38:09 +0000 2017
>Originator:     Manuel Bouyer
>Release:        NetBSD 8.0_BETA
>Organization:
>Environment:
System: NetBSD chartplotter 8.0_BETA NetBSD 8.0_BETA (CUBIEBOARD) #0: Thu Aug 24 13:02:21 CEST 2017 bouyer@bop.soc.lip6.fr:/dsk/l1/misc/bouyer/tmp/earmv7hf/obj/dsk/l1/misc/bouyer/netbsd-8/src/sys/arch/evbarm/compile/CUBIEBOARD evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:
	boost-lib fails to build on earmv7hf, I tracked it down to exceptions
	handling in c++. This small test program, made from boost config tests,
	reproduces it:
	cat > /tmp/conftest.cpp << EOF

//  (C) Copyright John Maddock 2001. 
//  Use, modification and distribution are subject to the 
//  Boost Software License, Version 1.0. (See accompanying file 
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/config for most recent version.

//  MACRO:         BOOST_NO_EXCEPTIONS
//  TITLE:         exception handling support
//  DESCRIPTION:   The compiler in its current translation mode supports
//                 exception handling.


namespace boost_no_exceptions{

void throw_it(int i)
{
   throw i;
}

int test()
{
   try
   {
      throw_it(2);
   }
   catch(int i)
   {
      return (i == 2) ? 0 : -1;
   }
   catch(...)
   {
      return -1;
   }
   return -1;
}

}

int main(){ return boost_no_exceptions::test(); }
EOF

	compile with:
	c++ -o /tmp/conftest -g /tmp/conftest.cpp

	On a x86_64 8.0_BETA host, this gives:
>/tmp/conftest 
>echo $status 
0

	but on earmv7hf:
>/tmp/conftest
terminate called after throwing an instance of 'int'
terminate called recursively
Abort
>echo $status 
134

	gdb shows:
(gdb) where
#0  0x70c9133c in _lwp_kill () from /usr/lib/libc.so.12
#1  0x70c88780 in abort () from /usr/lib/libc.so.12
#2  0x70dccd24 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/libstdc++.so.7
#3  0x70dd69b8 in __cxxabiv1::__terminate(void (*)()) ()
   from /usr/lib/libstdc++.so.7
#4  0x70dd6a54 in std::terminate() () from /usr/lib/libstdc++.so.7
#5  0x70dd699c in __cxa_rethrow () from /usr/lib/libstdc++.so.7
#6  0x70dccd30 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/libstdc++.so.7
#7  0x70dd69b8 in __cxxabiv1::__terminate(void (*)()) ()
   from /usr/lib/libstdc++.so.7
#8  0x70dd6a54 in std::terminate() () from /usr/lib/libstdc++.so.7
#9  0x70dd691c in __cxa_throw () from /usr/lib/libstdc++.so.7
#10 0x000108b0 in boost_no_exceptions::throw_it (i=2) at /tmp/conftest.cpp:18
#11 0x000108c8 in boost_no_exceptions::test () at /tmp/conftest.cpp:25
#12 0x00010950 in main () at /tmp/conftest.cpp:44


>How-To-Repeat:
	see above
>Fix:
	unknown, the problem seems to be in libstdc++

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 arm)
Date: Mon, 28 Aug 2017 13:03:22 +0200

 On Mon, Aug 28, 2017 at 10:55:00AM +0000, Manuel.Bouyer@lip6.fr wrote:
 > >Fix:
 > 	unknown, the problem seems to be in libstdc++

 It works for me in -current, and there are various toolchain parts not yet
 pulled up.

 Martin

From: Manuel Bouyer <manuel.bouyer@lip6.fr>
To: gnats-bugs@NetBSD.org
Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 arm)
Date: Thu, 31 Aug 2017 13:49:54 +0200

 On Mon, Aug 28, 2017 at 11:05:01AM +0000, Martin Husemann wrote:
 >  On Mon, Aug 28, 2017 at 10:55:00AM +0000, Manuel.Bouyer@lip6.fr wrote:
 >  > >Fix:
 >  > 	unknown, the problem seems to be in libstdc++
 >  
 >  It works for me in -current, and there are various toolchain parts not yet
 >  pulled up.

 AFAIK all pullup requests have been processed now, and this didn't fix
 the problem on netbsd-8 for me.  There is probably a missing pullup still. 
 Any idea where to look at ?

 -- 
 Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, Manuel.Bouyer@lip6.fr
Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 arm)
Date: Thu, 31 Aug 2017 14:08:18 +0200

 On Thu, Aug 31, 2017 at 11:55:01AM +0000, Manuel Bouyer wrote:
 > The following reply was made to PR port-arm/52509; it has been noted by GNATS.
 > 
 > From: Manuel Bouyer <manuel.bouyer@lip6.fr>
 > To: gnats-bugs@NetBSD.org
 > Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
 >         netbsd-bugs@netbsd.org
 > Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 >  arm)
 > Date: Thu, 31 Aug 2017 13:49:54 +0200
 > 
 >  On Mon, Aug 28, 2017 at 11:05:01AM +0000, Martin Husemann wrote:
 >  >  On Mon, Aug 28, 2017 at 10:55:00AM +0000, Manuel.Bouyer@lip6.fr wrote:
 >  >  > >Fix:
 >  >  > 	unknown, the problem seems to be in libstdc++
 >  >  
 >  >  It works for me in -current, and there are various toolchain parts not yet
 >  >  pulled up.
 >  
 >  AFAIK all pullup requests have been processed now, and this didn't fix
 >  the problem on netbsd-8 for me.  There is probably a missing pullup still. 
 >  Any idea where to look at ?

 Yes, only the preliminary pull ups are done.

 Joerg

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 arm)
Date: Fri, 1 Sep 2017 17:35:37 +0200

 This now also works on the netbsd-8 branch for me, can you confirm?

 Martin

From: Manuel Bouyer <manuel.bouyer@lip6.fr>
To: gnats-bugs@NetBSD.org
Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: port-arm/52509: c++ exceptions broken on earmv7hf (and maybe all
 arm)
Date: Fri, 1 Sep 2017 18:33:52 +0200

 On Fri, Sep 01, 2017 at 03:40:00PM +0000, Martin Husemann wrote:
 >  This now also works on the netbsd-8 branch for me, can you confirm?

 Yes, it works earmv7hf built with default options. This PR can be closed.
 thanks !

 -- 
 Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
      NetBSD: 26 ans d'experience feront toujours la difference
 --

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 01 Sep 2017 16:38:09 +0000
State-Changed-Why:
Fixed in -current and on netbsd-8


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.