[GiNaC-list] Bug? Segmentation while inverting a matrix

Patrick Schulz pschulz at posteo.de
Mon Jan 8 20:17:51 CET 2018


Interesting! 
The segfault is generated in 

0x00007ffff7a04bee in GiNaC::ex::subs(GiNaC::ex const&, unsigned int)
const () from /usr/lib/libginac.so

Backtrace:

(gdb) bt
#0  0x00007ffff7a04bee in GiNaC::ex::subs(GiNaC::ex const&, unsigned
int) const () from /usr/lib/libginac.so.6
#1  0x00007ffff7ae9cb5 in GiNaC::gcd(GiNaC::ex const&, GiNaC::ex
const&, GiNaC::ex*, GiNaC::ex*, bool, unsigned int) () from
/usr/lib/libginac.so.6
#2 0x00007ffff7ae9427 in ?? () from /usr/lib/libginac.so.6

(and then a lot of #1 and #2 ...)

#9033 0x00007ffff7af1502 in GiNaC::mul::normal(std::map<GiNaC::ex,
GiNaC::ex, GiNaC::ex_is_less, std::allocator<std::pair<GiNaC::ex const,
GiNaC::ex> > >&, std::map<GiNaC::ex, GiNaC::ex, GiNaC::ex_is_less,
std::allocator<std::pair<GiNaC::ex const, GiNaC::ex> > >&) const ()
from /usr/lib/libginac.so.6
#9034 0x00007ffff7ae20f8 in GiNaC::ex::normal() const () from
/usr/lib/libginac.so.6
#9035 0x00007ffff7ac5b89 in GiNaC::matrix::solve(GiNaC::matrix const&,
GiNaC::matrix const&, unsigned int) const () from
/usr/lib/libginac.so.6
#9036 0x00007ffff7ac6126 in GiNaC::matrix::inverse() const () from
/usr/lib/libginac.so.6
#9037 0x0000555555557f1a in main ()

So main() -> matrix::inverse() -> matrix::solve() -> ex::normal() ->
mul::normal() -> ??() -> GiNaC::gcd()

Strange that it works with the same conditions...

On Mon, 2018-01-08 at 13:30 +0000, Vladimir V. Kisil wrote:
> > > > > > On Mon, 8 Jan 2018 11:01:34 +0100, Vitaly Magerya
> > > > > > <vmagerya at gmail.com> said:
> 
>     VM> On 01/07/2018 05:08 PM, Patrick Schulz wrote:
>     >> I'm running archlinux (Kernel 4.14.12), my compiler is g++
> 7.2.1,
>     >> the GiNaC version i'm using is 1.7.2.
> 
>     VM> For what it's worth, your example works fine on my system
> (with
>     VM> the same GiNaC and GCC versions).
> 
>     It also works for me with GCC 7.2.0 and same GiNaC.
> 


More information about the GiNaC-list mailing list