[GiNaC-list] matrix::solve()-related problems

Richard B. Kreckel kreckel at in.terlu.de
Tue Jan 30 09:56:56 CET 2018


On 26.01.2018 23:42, Vitaly Magerya wrote:
> On 01/26/2018 02:24 PM, I wrote:
>>     matrix size  gauss time  bareiss time  gauss/bareiss
>>     2x2          0.00416815  0.00361022    1.15454
>>     3x3          0.0195643   0.0141638     1.38129
>>     4x4          0.0896266   0.0666258     1.34522
>>     5x5          0.205633    0.185446      1.10885
>>     6x6          0.730309    0.979617      0.745505
>>     7x7          1.29834     3.14298       0.413093
>>     8x8          2.46307     9.70648       0.253755
>>     9x9          4.4289      (segfaults)
>>     10x10        8.39434     (segfaults)
> 
> These segfaults have this sort of backtrace:
> 
> #1  0x00007ffff7a07f79 in GiNaC::ex::construct_from_basic(...)
> #2  0x00007ffff79e19e2 in GiNaC::basic::subs_one_level(...) const
> #3  0x00007ffff7b3d235 in GiNaC::power::subs(...) const
> #4  0x00007ffff7a0ba11 in GiNaC::expairseq::subschildren(...) const
> #5  0x00007ffff7a0bd64 in GiNaC::expairseq::subs(...) const
> #6  0x00007ffff7a08d4e in GiNaC::ex::subs(...) const
> #7  0x00007ffff7aeb6c0 in GiNaC::gcd(...)
> #8  0x00007ffff7aea806 in GiNaC::gcd_pf_pow(...)
> #9  0x00007ffff7aebbd0 in GiNaC::gcd(...)
> #10 0x00007ffff7aeac26 in GiNaC::gcd_pf_pow(...)
> #11 0x00007ffff7aebbd0 in GiNaC::gcd(...)
> 
> (repeat the last two lines a whole bunch of times)
> 
> #20147 0x00007ffff7aebbd0 in GiNaC::gcd(...)
> #20148 0x00007ffff7aeac26 in GiNaC::gcd_pf_pow(...)
> #20149 0x00007ffff7aea2f8 in GiNaC::gcd_pf_pow(...)
> #20150 0x00007ffff7aebbd0 in GiNaC::gcd(...)
> #20151 0x00007ffff7af214a in GiNaC::frac_cancel(...)
> #20152 0x00007ffff7af2b13 in GiNaC::mul::normal(...) const
> #20153 0x00007ffff7af2dd0 in GiNaC::add::normal(...) const
> #20154 0x00007ffff7af2947 in GiNaC::mul::normal(...) const
> #20155 0x00007ffff7ae613c in GiNaC::ex::normal() const
> #20156 0x00007ffff7ac73cc in GiNaC::matrix::solve(...) const
> #20157 0x0000000000404671 in main () at gauss-vs-bareiss.cpp:35
> 
> I think this is the same problem Patrick Schulz reported a bit earlier
> over here:
> 
> https://www.ginac.de/pipermail/ginac-list/2018-January/002168.html

Stack overflow.

Increasing the stack size to 1GiB with ulimit -s 1048576 makes the 9x9
case work for me in about 5 minutes.

But there must be something goofy going on here that ought to be debugged.

   -richy.


More information about the GiNaC-list mailing list