Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-16204

Segfault upgrading question categories - infinite recursion in question_category_next_parent_in()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.3
    • 1.9
    • Questions
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      Requires broken data in the question categories. Two categories that refer to one another causing a loop, e.g.

      select id, parent from mdl_question_categories where id in (830,882);
      id | parent
      ----+-------
      882 | 830
      830 | 882
      (2 rows)

      I know... should never happen, but above is from a client database.

      http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=commitdiff;h=d4354b8332dbed201bffb28164cc8a696fdd71b8 is a defensive patch that prevents the question_category_next_parent_in() function from recursing into a category it has already seen, thus preventing the infinite stack overflow that causes the segfault.

            timhunt Tim Hunt
            jonathan Jonathan Harker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.