[Coin-discuss] arithmetic exception when using Cbc

Michael Hennebry hennebry at web.cs.ndsu.nodak.edu
Thu Nov 2 20:10:18 EST 2006


On Thu, 2 Nov 2006, Kish Shen wrote:

> On Thursday 02 November 2006 17:27, Matthew Saltzman wrote:
> > On Thu, 2 Nov 2006, Kish Shen wrote:

> > > I am getting an arithmetic exception when using Cbc/Clp through OsiClp.
> > > The crash happens in CbcModel.cpp, in gcd (line 84 in the copy I am
> > > using):
> > >
> > >  while (remainder) {
> > >    remainder = b % a;
> > >    b = a;
> > >    a = remainder;
> > >  }
> > >  return b;
> > >
> > > The crash happens  in doing the % operation, I assume because a = -1.
> >
> > Seems like an arithmetic exception should be easy to find.  Do you know
> > what the args are that cause the crash?  What arch is this on?
> >
> The problem was run on 32 bit x86 Linux.
>
> By args do you mean the values of b, a etc.? Here are the values:
>  (gdb) p b
> $1 = -2147483648
> (gdb) p a
> $2 = -1
> (gdb) p remainder
> $3 = -1

If evalutating b%a required evaluating b/a,
that would explain the exception.
2147483648==2**31 and isn't representable
as a signed 32-bit number

> I guess b looks like it might be wrong. The gcd is called from line 346 of CbcModel.cpp:

-- 
Mike   hennebry at web.cs.ndsu.NoDak.edu
"it stands to reason that they weren't always called the ancients."
                                                      --  Daniel Jackson




More information about the Coin-discuss mailing list