Opened 19 months ago
Closed 14 months ago
#23545 closed defect (fixed)
Doctest: segmentation fault with coefficients() on symbolic expressions
Reported by:  vdelecroix  Owned by:  

Priority:  major  Milestone:  sage8.2 
Component:  symbolics  Keywords:  bug, symbolics 
Cc:  rws  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  617a644 (Commits)  Commit:  617a644051487e59a300ba37254b0ec7743aff82 
Dependencies:  Stopgaps: 
Description (last modified by )
On sage 8.0
sage: (x^2/(1+x)).coefficients() Segmentation fault (core dumped)
gdb shows that this is an infinite recursion in the Pynac library:
#0 GiNaC::add::integer_content (this=0x4095f00) at normal.cpp:95 #1 0x00007fff50051660 in GiNaC::ex::integer_content (this=this@entry=0x7fffff7ff410) at normal.cpp:81 #2 0x00007fff50076fdc in GiNaC::power::eval (this=0x7fffff800040, level=<optimized out>) at power.cpp:674 #3 0x00007fff4ff9b29e in GiNaC::ex::construct_from_basic (other=...) at ex.cpp:691 #4 0x00007fff50041ac3 in ex (other=..., this=0x7fffff800030) at ex.h:305 #5 GiNaC::mul::combine_ex_with_coeff_to_pair (this=0x40961a0, e=..., c=...) at mul.cpp:1228 #6 0x00007fff4ffa3084 in GiNaC::expairseq::evalchildren (this=this@entry=0x40961a0, level=1) at expairseq.cpp:1647 #7 0x00007fff50047390 in GiNaC::mul::eval (this=0x40961a0, level=<optimized out>) at mul.cpp:666 #8 0x00007fff4ff9b29e in GiNaC::ex::construct_from_basic (other=...) at ex.cpp:691 #9 0x00007fff50049ff6 in ex (other=..., this=0x7fffff800690) at ex.h:305 #10 GiNaC::mul::expand (this=0x4096030, options=0) at mul.cpp:1490 #11 0x00007fff4ff9ac0d in GiNaC::ex::expand (this=this@entry=0x7fffff800bf0, options=options@entry=0) at ex.cpp:84 #12 0x00007fff4ff9eec9 in expand (options=0, thisex=...) at ex.h:701 #13 GiNaC::match_monom (term=..., symb=..., vec=..., map=...) at ex.cpp:523 #14 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients (this=this@entry=0x7fffff800e00, s=..., vec=...) at ex.cpp:576 #15 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=..., vec=..., map=...) at ex.cpp:523 #16 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients (this=this@entry=0x7fffff8011c0, s=..., vec=...) at ex.cpp:576 #17 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=..., vec=..., map=...) at ex.cpp:523 #18 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients (this=this@entry=0x7fffff801580, s=..., vec=...) at ex.cpp:576 #19 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=..., vec=..., map=...) at ex.cpp:523 #20 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients (this=this@entry=0x7fffff801940, s=..., vec=...) at ex.cpp:576 [...]
Change History (14)
comment:1 Changed 19 months ago by
 Description modified (diff)
comment:2 Changed 19 months ago by
 Description modified (diff)
comment:3 Changed 19 months ago by
 Report Upstream changed from N/A to Reported upstream. Developers acknowledge bug.
The Pynac code does not check if the expression is a polynomial fraction in x
. That case cannot be handled via coefficient()
(the user should expand as a series). I will add a check to prevent this problem.
comment:4 Changed 19 months ago by
 Branch set to u/rws/segmentation_fault_with_coefficients___on_symbolic_expressions
comment:5 Changed 19 months ago by
 Commit set to 617a644051487e59a300ba37254b0ec7743aff82
 Dependencies set to pynac0.7.10
 Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release.
Pynac master has the fix. This branch adds doctests.
New commits:
617a644  23545: segmentation fault with coefficients() on symbolic expressions

comment:6 Changed 18 months ago by
 Priority changed from critical to major
While the core dump is fixed in develop, one of the doctests fails.
comment:7 Changed 18 months ago by
 Dependencies pynac0.7.10 deleted
 Report Upstream changed from Fixed upstream, in a later stable release. to Not yet reported upstream; Will do shortly.
comment:8 Changed 15 months ago by
 Dependencies set to #24262
 Report Upstream changed from Not yet reported upstream; Will do shortly. to N/A
comment:9 Changed 15 months ago by
comment:10 Changed 15 months ago by
comment:11 Changed 14 months ago by
 Milestone changed from sage8.1 to sage8.2
 Status changed from new to needs_review
 Summary changed from segmentation fault with coefficients() on symbolic expressions to Doctest: segmentation fault with coefficients() on symbolic expressions
comment:12 Changed 14 months ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
LGTM.
comment:13 Changed 14 months ago by
 Dependencies #24262 deleted
comment:14 Changed 14 months ago by
 Branch changed from u/rws/segmentation_fault_with_coefficients___on_symbolic_expressions to 617a644051487e59a300ba37254b0ec7743aff82
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Confirmed. I added a minimal case.