Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2715

Recursion of copy_source_ops() causes stack overflow in Apache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • trunk
    • 1.8-consider
    • libsvn_delta
    • None

    Description

      See URL.  In summary, libsvn_delta/compose_delta.c:copy_source_ops() can recurse
      a large number of times (the linked report describes a recursion depth of nearly
      2200 calls).
      
      If I understand DannyB correctly, the delta combiner is intrinsically O(N^2)
      when considering targe-copy instructions (i.e. as generated by vdelta), so this
      level of recursion may well be unavoidable (though some independent
      investigation of that might be nice).
      
      The problem here is that we typically have a limited function-call stack, so an
      overflow will terminate the process.  DannyB suggested (and I agree) that we
      should convert copy_source_ops() from a recursive function to one that maintains
      a pool-allocated stack, so that a deep recursion can only use up heap memory,
      not C stack memory.
      

      http://svn.haxx.se/dev/archive-2007-01/0709.shtml

      Original issue reported by malcolm

      Attachments

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: