Changes between Initial Version and Version 5 of Ticket #13719


Ignore:
Timestamp:
11/20/12 11:05:34 (6 years ago)
Author:
jpflori
Comment:

Updated patch with local doctest, feel free to devise a better one.

I just realized that I did not mention that this should go quite undetectable unless one uses MALLOC_CHECK. Nonetheless, as ones write something in memory which was not allocated for this purpose, the fixed bug should potentially lead to segfaults (although this obviously never happened since this code is in Sage, or not frequently enough to be reported).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13719

    • Property Status changed from new to needs_review
    • Property Keywords graphs segfault added
    • Property Component changed from memleak to graph theory
    • Property Authors changed from to Jean-Pierre Flori
  • Ticket #13719 – Description

    initial v5  
    1717...
    1818}}}
    19 This indicates a double free/other memory management problem. Refcount wrong?
     19
     20For tree with no vertices, no memory was allocated (more or less as intended, with a malloc with size 0), but the next routine of the iterator tries to write something at the "allocated" address.
     21
     22This is fixed by handling separately the 0 sized trees and not allocating nor writing anything in this case.