Opened 9 years ago

Closed 9 years ago

#11019 closed defect (fixed)

BooleanPolynomial.lex_lead() shouldn't crash on zero

Reported by: malb Owned by: malb
Priority: major Milestone: sage-4.7
Component: commutative algebra Keywords: polybori, sigsegv
Cc: AlexanderDreyer, PolyBoRi Merged in: sage-4.7.alpha5
Authors: Martin Albrecht Reviewers: Alexander Dreyer
Report Upstream: None of the above - read trac for reasoning. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by malb)

This is bad:

sage: B.<a,b,c> = BooleanPolynomialRing()
sage: B(0).lex_lead()
terminate called after throwing an instance of 
'polybori::PBoRiGenericError<7u>'
  what():  Illegal operation on zero diagram or (sub-)polynomial.
/home/malb/Sage/current/local/bin/sage-sage: line 300: 10210 Aborted                 
sage-ipython "$@" -i

Apply attachment:trac_11019.patch

Attachments (1)

trac_11019.patch (1.1 KB) - added by malb 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by malb

comment:1 Changed 9 years ago by malb

  • Description modified (diff)
  • Status changed from new to needs_review

Btw. I couldn't go for throwing an error because sometimes gbcore.py calls lex_lead() on zero. So I opted for returning zero which seems to work.

comment:2 Changed 9 years ago by AlexanderDreyer

The patch looks good, so code-review by inspection is positive already, I'll apply it for a technical review. But gbcore.py shouldn't call lex_lead on zero, so maybe you can provide me the corresponding examples off-trac for upstream debugging?

comment:3 Changed 9 years ago by AlexanderDreyer

  • Status changed from needs_review to positive_review

Applies smoothly on Sage 4.6.2 with the PolyBoRi? 0.7.0-patch, tested in sage/{rings,crypto,libs} succeed. So positive review!

comment:4 Changed 9 years ago by jdemeyer

  • Reviewers set to Alexander Dreyer

comment:5 Changed 9 years ago by jdemeyer

  • Merged in set to sage-4.7.alpha5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.