Opened 13 years ago

Closed 9 years ago

#8573 closed defect (fixed)

prod(primes_first_n(64)).divisors() crashes

Reported by: asdjughewou9474388 Owned by: tbd
Priority: minor Milestone: sage-6.2
Component: basic arithmetic Keywords: integer divisors
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: 8c68d72 (Commits, GitHub, GitLab) Commit: 8c68d72c9c03ea70990c19eced71d70ad6624f3b
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

sage: prod(primes_first_n(64)).divisors()
------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Sage will now terminate.
------------------------------------------------------------------------

The crash is due to the fact that the number has exactly 2^64 divisors and this overflows a C integer.

Change History (16)

comment:1 Changed 13 years ago by asdjughewou9474388

Keywords: divisors added

comment:2 Changed 9 years ago by Marc Mezzarobba

Milestone: sage-duplicate/invalid/wontfix
Status: newneeds_review

It now (6.1) fails with a MemoryError, which looks reasonable to me.

comment:3 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)
Reviewers: Marc Mezzarobba, Jeroen Demeyer
Status: needs_reviewpositive_review

comment:4 Changed 9 years ago by Jeroen Demeyer

Reviewers: Marc Mezzarobba, Jeroen Demeyer
Status: positive_reviewneeds_work
Summary: prod(primes(190)).divisors() crashesprod(primes(311)).divisors() crashes

comment:5 Changed 9 years ago by Jeroen Demeyer

Component: factorizationbasic arithmetic
Description: modified (diff)
Keywords: integer added; product primes 190 removed
Milestone: sage-duplicate/invalid/wontfixsage-6.2
Summary: prod(primes(311)).divisors() crashesprod(primes_first_n(64)).divisors() crashes

comment:6 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)

comment:7 Changed 9 years ago by Jeroen Demeyer

Branch: u/jdemeyer/ticket/8573
Modified: Feb 3, 2014, 10:32:52 AMFeb 3, 2014, 10:32:52 AM

comment:8 Changed 9 years ago by Jeroen Demeyer

Status: needs_workneeds_review

comment:9 Changed 9 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer
Commit: 8c68d72c9c03ea70990c19eced71d70ad6624f3b

New commits:

8c68d72Add overflow check to divisors()

comment:10 Changed 9 years ago by Ralf Stephan

Branch: u/jdemeyer/ticket/8573u/rws/ticket/8573
Modified: Feb 5, 2014, 9:33:59 AMFeb 5, 2014, 9:33:59 AM

comment:11 Changed 9 years ago by Ralf Stephan

Commit: 8c68d72c9c03ea70990c19eced71d70ad6624f3b7e1f981184af2bda242e7f87b88e7e69c5ffb7ba
Reviewers: Ralf Stephan
Status: needs_reviewpositive_review

Rebased on 6.2.beta3. Tests OK --long in rings/. Seems to be an uncomplicated change.


New commits:

7e1f981Merge branch 'u/jdemeyer/ticket/8573' of git://trac.sagemath.org/sage into ticket/8573

comment:12 Changed 9 years ago by git

Commit: 7e1f981184af2bda242e7f87b88e7e69c5ffb7ba42a405b44485e706741706ecf8f9e3113de05d33
Status: positive_reviewneeds_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

42a405bMerge branch 'develop' (6.2.beta4) into ticket/8573

comment:13 Changed 9 years ago by Jeroen Demeyer

Branch: u/rws/ticket/8573u/jdemeyer/ticket/8573
Commit: 42a405b44485e706741706ecf8f9e3113de05d338c68d72c9c03ea70990c19eced71d70ad6624f3b
Status: needs_reviewpositive_review

Why change the branch all the time?


New commits:

8c68d72Add overflow check to divisors()

comment:14 in reply to:  13 Changed 9 years ago by Ralf Stephan

Replying to jdemeyer:

Why change the branch all the time?

https://groups.google.com/forum/#!topic/sage-devel/sTLT83d1g14

comment:15 Changed 9 years ago by Jeroen Demeyer

In this ticket, you made no changes, so there is no reason at all to commit/push anything. I'm not complaining about changing the branch, I am complaining about changing the branch without making any changes.

comment:16 Changed 9 years ago by Volker Braun

Branch: u/jdemeyer/ticket/85738c68d72c9c03ea70990c19eced71d70ad6624f3b
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.