#15820: Implement sequences of bounded integers
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  algebra            |   Resolution:
       Keywords:  sequence bounded   |    Merged in:
  integer                            |    Reviewers:
        Authors:  Simon King         |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  6dfb1cb1c6dc5704e2a8918cf2aeabdd8dbef69a
  u/SimonKing/ticket/15820           |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Good that I added the stress test!

 Replying to [comment:143 vbraun]:
 > I'm getting three valgrind warnings (#15586):
 > {{{
 > sage: sage: from sage.misc.bounded_integer_sequences import
 _biseq_stresstest
 > sage: _biseq_stresstest()
 > ==3937== Invalid read of size 8
 > ==3937==    at 0x30A524B0: __gmpn_rshift (rshift.c:55)
 > ==3937==    by 0x48CCB50B:
 __pyx_f_4sage_4misc_25bounded_integer_sequences_contains_biseq
 (bounded_integer_sequences.c:2611)
 > ==3937==    by 0x48CD388A:
 __pyx_pf_4sage_4misc_25bounded_integer_sequences_2_biseq_stresstest
 (bounded_integer_sequences.c:8902)
 > ==3937==    by 0x48CD388A:
 __pyx_pw_4sage_4misc_25bounded_integer_sequences_3_biseq_stresstest
 (bounded_integer_sequences.c:8038)
 > ==3937==    by 0x4F3E768: call_function (ceval.c:4017)
 > ==3937==    by 0x4F3E768: PyEval_EvalFrameEx (ceval.c:2679)
 > [...]
 > ==3937==  Address 0xecfe560 is 0 bytes after a block of size 16 alloc'd
 > ==3937==    at 0x4C29BCF: malloc (vg_replace_malloc.c:296)
 > ==3937==    by 0x142EC8FD: sage_malloc (in /home/vbraun/Sage/git-
 develop/local/lib/libcsage.so)
 > ==3937==    by 0x142EC9E4: sage_gmp_malloc (in /home/vbraun/Sage/git-
 develop/local/lib/libcsage.so)
 > ==3937==    by 0x30A439EE: __gmpz_init2 (init2.c:33)
 > ==3937==    by 0x48CCE302:
 __pyx_f_4sage_4misc_25bounded_integer_sequences_concat_biseq
 (bounded_integer_sequences.c:2256)
 > ==3937==    by 0x48CD6806:
 
__pyx_pf_4sage_4misc_25bounded_integer_sequences_22BoundedIntegerSequence_31__add__
 (bounded_integer_sequences.c:7201)
 > ==3937==    by 0x48CD6806:
 
__pyx_pw_4sage_4misc_25bounded_integer_sequences_22BoundedIntegerSequence_32__add__
 (bounded_integer_sequences.c:7078)
 > ==3937==    by 0x4E80BC8: binary_op1 (abstract.c:945)
 > ==3937==    by 0x4E80BC8: PyNumber_Add (abstract.c:1185)
 > ==3937==    by 0x48CD39AD:
 __pyx_pf_4sage_4misc_25bounded_integer_sequences_2_biseq_stresstest
 (bounded_integer_sequences.c:8281)
 > ==3937==    by 0x48CD39AD:
 __pyx_pw_4sage_4misc_25bounded_integer_sequences_3_biseq_stresstest
 (bounded_integer_sequences.c:8038)
 > ==3937==    by 0x4F3E768: call_function (ceval.c:4017)
 > ==3937==    by 0x4F3E768: PyEval_EvalFrameEx (ceval.c:2679)
 > [...]
 }}}
 Do I understand correctly: It means that `contains_biseq` could read and
 `concat_biseq` could write stuff in non-allocated memory?

 {{{
 > ==3937== Conditional jump or move depends on uninitialised value(s)
 > ==3937==    at 0x48CCB5C3:
 __pyx_f_4sage_4misc_25bounded_integer_sequences_contains_biseq
 (bounded_integer_sequences.c:2828)
 > ==3937==    by 0x48CD388A:
 __pyx_pf_4sage_4misc_25bounded_integer_sequences_2_biseq_stresstest
 (bounded_integer_sequences.c:8902)
 > ==3937==    by 0x48CD388A:
 __pyx_pw_4sage_4misc_25bounded_integer_sequences_3_biseq_stresstest
 (bounded_integer_sequences.c:8038)
 > ==3937==    by 0x4F3E768: call_function (ceval.c:4017)
 > ==3937==    by 0x4F3E768: PyEval_EvalFrameEx (ceval.c:2679)
 > ==3937==    by 0x4F3F24F: PyEval_EvalCodeEx (ceval.c:3265)
 > ==3937==    by 0x4F3F378: PyEval_EvalCode (ceval.c:673)
 > }}}
 > The middle one is almost certainly an error, the other two don't look
 too good either.

 Will the given line numbers (2611, 2256, 2828) be the same on my machine?

--
Ticket URL: <http://trac.sagemath.org/ticket/15820#comment:144>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to