Ticket #1008 (new defect)

Opened 2 years ago

Last modified 22 months ago

coverage report generation fails with some non-ascii chars

Reported by: dcrawford Owned by: gz
Priority: normal Milestone:
Component: IDE Version: 1.8
Keywords: ITA Cc:

Description (last modified by gz) (diff)

coverage report generation fails with

Failed assertion: (<= ccl::newpos ccl::end)

in at least ccl 1.7-15111 and 1.8-15408 with some non-ascii characters. A set of tests had four lines of non-ascii, 3 of them wouldn't break report generation but the other one would. I was able to reduce to the following test case.

make empty dir /tmp/coverage

foo.lisp:
(defun foo ()
  "Ἀλέξανδρος ὁ Μέγας")

repl:
(progn (require :cover)
       (setq ccl:*compile-code-coverage* t))
(ccl::report-coverage  "/tmp/coverage/")



will give the following error and backtrace:


Failed assertion: (<= ccl::newpos ccl::end)

   [Condition of type simple-error]

Restarts:
 0: [continue] test the assertion again.
 1: [abort] Return to SLIME's top level.

Backtrace:
  0: ((:internal ccl::output-subnotes ccl::output-coverage-html-acode) 52)
      Arguments:
         0 (ccl::limit): 52
      Locals:
         0 (ccl::note): #<code-note [nil] for "home:foo.lisp":16-54 "\"ἈλέξανδρÎ" #x302000B2A26D>
         1 (ccl::prefix): "f0c"
         2 (ccl::output): #<basic-file-character-output-stream ("/tmp/coverage/foo_lisp.html"/5 iso-8859-1) #x302000CDF9BD>
         3 (ccl::s): #S(ccl::coverage-html-state :input #<vector-input-stream  #x302000CDBEED> :output #<basic-file-character-output-stream ("/tmp/coverage/foo_lisp.html"/5 iso-8859-1) #x302000CDF9BD> :prefix ...)
         4 (ccl::note-queue): nil
  1: ((:internal ccl::output-subnotes ccl::output-coverage-html-acode) 86)
      Arguments:
         0 (ccl::limit): 86
      Locals:
         0 (ccl::note): #<code-note [nil] for "home:foo.lisp":0-55 "(defun foo () \"Ἀλέξανδρο" #x302000B2A2AD>
         1 (ccl::prefix): "f0c"
         2 (ccl::output): #<basic-file-character-output-stream ("/tmp/coverage/foo_lisp.html"/5 iso-8859-1) #x302000CDF9BD>
         3 (ccl::s): #S(ccl::coverage-html-state :input #<vector-input-stream  #x302000CDBEED> :output #<basic-file-character-output-stream ("/tmp/coverage/foo_lisp.html"/5 iso-8859-1) #x302000CDF9BD> :prefix ...)
         4 (ccl::note-queue): nil
      Catch-tags:
        nil
        nil
        nil
  2: (report-coverage "/tmp/coverage/" :external-format :default :statistics t :html t :tags nil)
      Arguments:
         0 (ccl::output-file): "/tmp/coverage/"
         1 (external-format): :default
         2 (ccl::statistics): t
         3 (ccl::html): t
         4 (ccl::tags): nil
      Locals:
         0 (ccl::paths): nil
         1 (directory): #P"/tmp/coverage/"
         2 (ccl::coverage-dir): #P"/home/davidcrawford/"
         3 (ccl::frame-file): #P"/tmp/coverage/index.html"
         4 (ccl::index-file): #P"/tmp/coverage/index_html.html"
         5 (ccl::tags-file): nil
         6 (ccl::stats-file): #P"/tmp/coverage/statistics.csv"
         7 (ccl::*coverage-tags*): nil
         8 (ccl::*code-note-tags*): nil
         9 (ccl::*file-coverage*): ((#2="home:foo.lisp.newest" (#1=#<Compiled-function foo #x302000B2A2DF>) (#1#) . #S(coverage-statistics :source-file #2# :expressions-total 2 :expressions-entered ...)))
        10 (ccl::*coverage-frame-name*): "FF65094ECA10883A4"
        11 (ccl::*code-note-subnotes*): #<hash-table :test eq size 3/60 #x302000C857BD>
        12 (ccl::*code-note-function*): #<hash-table :test eq size 2/60 #x302000C8522D>
        13 (ccl::*entry-note-function*): #<hash-table :test eq size 1/60 #x302000C84C9D>
        14 (ccl::*code-note-index*): #<hash-table :test eq size 2/60 #x302000C8470D>
        15 (ccl::*emitted-code-notes*): #(#<code-note [nil] for "home:foo.lisp":16-54 "\"ἈλέξανδρÎ" #x302000B2A26D> #<code-note [nil] for "home:foo.lisp":0-55 "(defun foo () \"Ἀλέξανδρο" #x302000B2A2AD>)
        16 (ccl::*source-note-index*): #<hash-table :test eq size 2/60 #x302000C83E1D>
        17 (ccl::*source-code-notes*): #<hash-table :test eq size 2/60 #x302000C8388D>
        18 (ccl::*covered-source-notes*): #(#<source-note "home:foo.lisp":0-55 "(defun foo () \"Ἀλέξανδρο"> #<source-note "home:foo.lisp":16-54 "\"ἈλέξανδρÎ">)
        19 (#:loop-list-173830): nil
        20 (ccl::data): ("home:foo.lisp.newest" #(#<Compiled-function foo #x302000B2A2DF>) :default 240549126874)
        21 (ccl::file): "home:foo.lisp.newest"
        22 (truename): #P"/home/davidcrawford/foo.lisp"
        23 (ccl::src-name): "foo.lisp"
        24 (ccl::html-name): "foo_lisp"
        25 (ccl::coverage): (#2="home:foo.lisp.newest" (#1=#<Compiled-function foo #x302000B2A2DF>) (#1#) . #S(coverage-statistics :source-file #2# :expressions-total 2 :expressions-entered ...))

Change History

comment:1 Changed 2 years ago by gz

  • Keywords ITA added
  • Description modified (diff)

comment:2 Changed 2 years ago by dcrawford

Oh, and compile foo.lisp before the report-coverage call.

comment:3 Changed 2 years ago by gz

  • Owner set to gz

comment:4 Changed 22 months ago by dcrawford

Gail, any new information on this?

Note: See TracTickets for help on using tickets.