On Wed, Jan 30, 2019 at 01:36:17PM +0100, Otto Moerbeek wrote:

> On Wed, Jan 30, 2019 at 01:21:55PM +0100, Jeremie Courreges-Anglas wrote:
> 
> > On Wed, Jan 30 2019, Otto Moerbeek <[email protected]> wrote:
> > > Hi,
> > >
> > > net/powerdns does not work well on sparc64. It is a C++ program that
> > > uses exceptions quite extensively. The case I'm running into is a
> > > unknown item in a config file. The code should catch the exception and
> > > exit gracefully with an proper error message, but instead a catch-all
> > > is being hit:
> > >
> > > Jan 30 13:12:42 Reading random entropy from '/dev/urandom'
> > > Jan 30 13:12:42 Loading '/usr/local/lib/pdns/libgsqlite3backend.so'
> > > Jan 30 13:12:42 This is a standalone pdns
> > > Jan 30 13:12:42 Listening on controlsocket in 
> > > '/var/run/pdns.controlsocket'
> > > terminate called after throwing an instance of 'PDNSException'
> > > terminate called recursively
> > > Abort trap (core dumped) 
> > >
> > > Is C++ exception handling a known broken thing on sparc64? 
> > >
> > > Any suggested remedy or should the port just be marked broken for
> > > sparc64? 
> > >
> > > On amd64 the config file error is handled correctly.
> > 
> > I've noticed this in the last sparc64 bulk build report:
> > 
> >   
> > http://build-failures.rhaalovely.net//sparc64/2019-01-10/net/amule,-daemon.log
> > 
> > I haven't looked into the details yet.  It might be a fluke, or it might
> > support your "exceptions are broken" theory.
> 
> This is reproducable on 6.3 and 6.4, so it is not recent breakage.
> 
> I'll try to write a test program.
> 
>       -Otto
> 

The test program below already shows the problem when compiled with eg++
(and clang++ for that matter). This is using the most recent snap.

The base C++ compiler does produce the correct result.

$ eg++ x.cc && ./a.out
terminate called after throwing an instance of 'ex'
terminate called recursively
Abort trap (core dumped) 
$ c++ x.cc && ./a.out  
Catching...
$

        -Otto

#include <iostream>

class ex {
};

void f(void) 
{
        throw ex();
}

int main()
{
        try {
                f();
        }
        catch (const ex & myex) {
                std::cout << "Catching..." << std::endl;
        }
}


Reply via email to