Menu

#4070 Cyclic markup detection unable to deal with non-linear code execution

Verified
nobody
Defect
2014-09-04
2014-08-18
Anonymous
No

Originally created by: *anonymous

Originally created by: dak@gnu.org
Originally owned by: dak@gnu.org

The cyclic markup detection implemented as issue 380 is unable to account for non-local exits and accumulates its problem markers over multiple sessions of one LilyPond run.  One example code directly causing an overflow is

#@(make-list 100
  #{ \markup \with-color #red \override-lines #'(baseline-skip . 0) { x } #})

resulting in
error: Cyclic markup detected: line-markup
error: Cyclic markup detected: line-markup
error: Cyclic markup detected: line-markup
error: Cyclic markup detected: [...]

even though every single markup is just few levels deep.  However, the implementation of map-markup-commands (used internally from the parser in order to allow the use of a markup command on the result of a markup list command) uses throw/catch internally and consequently wrecks the bookkeeping of interpret-markup.

While this functionality, implemented as issue 3270, is probably the worst systematic trigger of the cyclic markup detection problems, it is by no means extraordinary.

Discussion

  • Google Importer

    Google Importer - 2014-08-18

    Originally posted by: dak@gnu.org

    Issue 4070: Cyclic markup detection unable to deal with non-linear code execution

    This uses dynamic winding to keep the stack depth counts accurate even
    in the presence of non-local exits like those used of
    map-markup-commands.  It also changes the regtest
    markup-cyclic-reference.ly since it seems too much trouble to trap both
    cyclic references via a tortoise/hare algorithm as well as limiting the
    maximum markup stack depth.

    http://codereview.appspot.com/127480043

    Labels: Patch-new
    Owner: dak@gnu.org
    Status: Started

     
  • Google Importer

    Google Importer - 2014-08-18

    Originally posted by: dak@gnu.org

    Patchy the autobot says: passes tests.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2014-08-21

    Originally posted by: pkx1...@gmail.com

    Patch on countdown for August 24th

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2014-08-24

    Originally posted by: pkx1...@gmail.com

    Patch counted down - please push

    Labels: -Patch-countdown Patch-push

     
  • Google Importer

    Google Importer - 2014-08-24

    Originally posted by: dak@gnu.org

    Pushed to staging as
    commit [rdbb052ff31e25cbb21791363a58271f55d0c5be0]
    Author: David Kastrup <dak@gnu.org>
    Date:   Mon Aug 18 18:17:05 2014 +0200

        Issue 4070: Cyclic markup detection unable to deal with non-linear code execution
       
        This uses dynamic winding to keep the stack depth counts accurate even
        in the presence of non-local exits like those used of
        map-markup-commands.  It also changes the regtest
        markup-cyclic-reference.ly since it seems too much trouble to trap both
        cyclic references via a tortoise/hare algorithm as well as limiting the
        maximum markup stack depth.

    Labels: -Patch-push Fixed_2_19_13
    Status: Fixed

     
  • Google Importer

    Google Importer - 2014-09-04

    Originally posted by: ColinPKC...@gmail.com

    (No comment was entered for this change.)

    Status: Verified

     
MongoDB Logo MongoDB