#13731: Fix libsingular memory management
---------------------------+------------------------------------------------
       Reporter:  nbruin   |         Owner:  rlm     
           Type:  defect   |        Status:  new     
       Priority:  major    |     Milestone:  sage-5.6
      Component:  memleak  |    Resolution:          
       Keywords:           |   Work issues:          
Report Upstream:  N/A      |     Reviewers:          
        Authors:           |     Merged in:          
   Dependencies:           |      Stopgaps:          
---------------------------+------------------------------------------------

Comment (by nbruin):

 Replying to [comment:29 SimonKing]:
 > It is not clear to me what you mean by "those two snippets":

 This one:
 > the snippets that I provided in my previous post?

 But don't take my word for it. The report is in the `sage-devel` thread:
 {{{
 ==20553== Invalid read of size 8
 ==20553==    at 0x2694CB7C: gnc_mm_Mult_nn(int*, int*, sip_sring*)
 (gring.cc:503)
 ==20553==    by 0x2694DABB: gnc_p_Mult_mm_Common(spolyrec*, spolyrec*,
 int, sip_sring*) (gring.cc:424)
 ==20553==    by 0x269C7726: p_Power(spolyrec*, int, sip_sring*)
 (gring.h:181)
 ...
 ==20553==  Address 0x40c39c48 is 8 bytes inside a block of size 12 alloc'd
 ==20553==    at 0x4A0762F: malloc (vg_replace_malloc.c:270)
 ==20553==    by 0x26BADA45: omEmulateAlloc0 (omAllocEmulate.c:15)
 ==20553==    by 0x2694C9EE: gnc_mm_Mult_nn(int*, int*, sip_sring*)
 (gring.cc:472)
 ==20553==    by 0x2694DABB: gnc_p_Mult_mm_Common(spolyrec*, spolyrec*,
 int, sip_sring*) (gring.cc:424)
 ==20553==    by 0x269C7726: p_Power(spolyrec*, int, sip_sring*)
 (gring.h:181)
 }}}
 Wait a minute ... valgrind complains EARLIER! Line 503 rather than 507. So
 valgrind already seems unhappy with
 {{{
     p_MemAdd_LengthGeneral(F, G, ExpSize/sizeof(long));
 }}}
 It's not immediately clear to me that `ExpSize/sizeof(long)` really is (at
 most) `rN+1` (see `p_MemAdd.h` for the definition). The singular source is
 now my most-grepped directory.

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