#10435: Invalid write in bitsets
-----------------------------+----------------------------------------------
   Reporter:  rlm            |       Owner:  jason     
       Type:  defect         |      Status:  needs_work
   Priority:  major          |   Milestone:  sage-4.6.2
  Component:  misc           |    Keywords:            
     Author:  Robert Miller  |    Upstream:  N/A       
   Reviewer:  Nathann Cohen  |      Merged:            
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by jdemeyer):

  * status:  positive_review => needs_work


Comment:

 This seems to cause problems on some Skynet machines, for example on
 {{{hawk}}} (OpenSolaris 06.2009-32):

 {{{
 sage -t -long  -force_lib devel/sage/sage/misc/misc_c.pyx
 **********************************************************************
 File
 
"/export/home/buildbot/build/sage/hawk-1/hawk_full/build/sage-4.6.2.alpha0/devel
 /sage-main/sage/misc/misc_c.pyx", line 598:
     sage: test_bitset('00'*64, '01'*64, 128)
 Expected:
     a
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     list a []
     a.size 128
     len(a) 0
     a.limbs ...
     b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a.in(n)   False
     a.not_in(n)   True
     a.add(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.discard(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.set_to(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.flip(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.set_first_n(n)
 
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     a.first_in_complement()    -1
     a.isempty()  True
     a.eq(b)      False
     a.cmp(b)     -1
     a.issubset(b) True
     a.issuperset(b) False
     a.copy()
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     r.clear()
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     complement a
 
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     a intersect b
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a union b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a minus b
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a symmetric_difference b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a.rshift(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.lshift(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.first()           -1
     a.next(n)           -1
     a.first_diff(b)     1
     a.next_diff(b, n)   -1
     a.hamming_weight()  0
     a.hamming_weight_sparse()  0
     rshifts add  True
     lshifts add  True
     intersection commutes True
     union commutes  True
     not not = id True
     flipped bit  -1
     add bit      -1
     discard bit    -1
     lshift add unset ok True
     rshift set unset ok True
     reallocating a
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to size 128
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to size 256
 
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to original size
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 Got:
     a
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     list a []
     a.size 128
     len(a) 0
     a.limbs 4
     b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a.in(n)   True
     a.not_in(n)   False
     a.add(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.discard(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.set_to(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.flip(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.set_first_n(n)
 
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     a.first_in_complement()    -1
     a.isempty()  True
     a.eq(b)      False
     a.cmp(b)     -1
     a.issubset(b) True
     a.issuperset(b) False
     a.copy()
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     r.clear()
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     complement a
 
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     a intersect b
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a union b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a minus b
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a symmetric_difference b
 
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
     a.rshift(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.lshift(n)
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     a.first()           -1
     a.next(n)           -1
     a.first_diff(b)     1
     a.next_diff(b, n)   -1
     a.hamming_weight()  0
     a.hamming_weight_sparse()  0
     rshifts add  True
     lshifts add  True
     intersection commutes True
     union commutes  True
     not not = id True
     flipped bit  -1
     add bit      -1
     discard bit    -1
     lshift add unset ok True
     rshift set unset ok True
     reallocating a
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to size 128
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to size 256
 
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
     to original size
 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 **********************************************************************
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10435#comment:9>
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