#11754: Computation of rank-decompositions in Sage
-----------------------------+----------------------------------------------
   Reporter:  ncohen         |          Owner:  jason, ncohen, rlm
       Type:  enhancement    |         Status:  needs_work        
   Priority:  major          |      Milestone:  sage-5.0          
  Component:  graph theory   |       Keywords:                    
Work_issues:                 |       Upstream:  N/A               
   Reviewer:  David Coudert  |         Author:  Nathann Cohen     
     Merged:                 |   Dependencies:                    
-----------------------------+----------------------------------------------
Changes (by dcoudert):

  * status:  needs_review => needs_work


Comment:

 Good news, I have identified the cause of my segfault !

 In function `init_rw_dec`, with N=30, I have `sizeof(subset_t) * (1ul <<
 n) == 0` !!!
 Consequently, the malloc function returns a pointer.
 This is a stupid numerical problem.
 We have `sizeof(subset_t)==4` and `(1ul<<30)==1073741824`. But at least on
 my computer, it happens that `4294967296==0 mod(2^32)`...

 So you should add a test like this just after the malloc:
 {{{
 if((sizeof(subset_t) * (1ul << n)==0) && (n>0) && cslots) return(-1);
 }}}

 A similar test in function `init_rw` could be safer.


 No news concerning the compilation error.

 Best,
 D.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11754#comment:34>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to