GNU bug report logs - #14849
(system vm coverage) `line-execution-counts' misleading output

Previous Next

Package: guile;

Reported by: taylanbayirli <at> gmail.com (Taylan Ulrich B.)

Date: Fri, 12 Jul 2013 14:48:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14849 in the body.
You can then email your comments to 14849 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#14849; Package guile. (Fri, 12 Jul 2013 14:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to taylanbayirli <at> gmail.com (Taylan Ulrich B.):
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Fri, 12 Jul 2013 14:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: taylanbayirli <at> gmail.com (Taylan Ulrich B.)
To: bug-guile <at> gnu.org
Subject: (system vm coverage) `line-execution-counts' misleading output
Date: Fri, 12 Jul 2013 16:47:00 +0200
The following shell/guile transcript showcases a minimal test-case for
when a tail-call fools the code-coverage module into thinking that the
line with the tail-call was not executed.

The result in the Guile transcript, $1, is an alist from line numbers
(starting from zero) to execution counts.

Converting the relevant coverage-data object into LCOV data via
`coverage-data->lcov', as advertised in (info "(guile) Code
Coverage"), then to HTML via LCOV's genhtml(1), will result in the
relevant line being colored red and contribute negatively to the total
line-coverage percentage.

=== BEGIN TRANSCRIPT ===
$ cat /tmp/test.scm  
(define (tail-call-test)
  (display "foo\n")
  (tail-call-target))

(define (tail-call-target)
  (display "bar\n"))
$ guile              
GNU Guile 2.0.9.20-10454
Copyright (C) 1995-2013 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (begin
...   (load "/tmp/test.scm")
...   (call-with-values
...       (lambda ()
...         ((@ (system vm coverage) with-code-coverage)
...          ((@ (system vm vm) the-vm))
...          tail-call-test))
...     (lambda (data . values)
...       ((@ (system vm coverage) line-execution-counts) data "/tmp/test.scm"))))
;;; <stdin>:0:4095: warning: possibly unbound variable `tail-call-test'
foo
bar
$1 = ((5 . 1) (4 . 1) (2 . 0) (1 . 1) (0 . 1))
scheme@(guile-user)> 
=== END TRANSCRIPT ===




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Tue, 21 Jun 2016 07:10:02 GMT) Full text and rfc822 format available.

Notification sent to taylanbayirli <at> gmail.com (Taylan Ulrich B.):
bug acknowledged by developer. (Tue, 21 Jun 2016 07:10:02 GMT) Full text and rfc822 format available.

Message #10 received at 14849-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: taylanbayirli <at> gmail.com (Taylan Ulrich B.)
Cc: 14849-done <at> debbugs.gnu.org
Subject: Re: bug#14849: (system vm coverage) `line-execution-counts'
 misleading output
Date: Tue, 21 Jun 2016 09:09:02 +0200
I have tried this one on master and it exhibits the results you expect,
not the buggy results.  I added the test to the test suite.  I don't
plan on devoting resource to fixing this bug in 2.0 though, so I'm
closing it for now.  Feel free to reopen if you hvae a patch to fix :)

Andy

On Fri 12 Jul 2013 16:47, taylanbayirli <at> gmail.com (Taylan Ulrich B.) writes:

> The following shell/guile transcript showcases a minimal test-case for
> when a tail-call fools the code-coverage module into thinking that the
> line with the tail-call was not executed.
>
> The result in the Guile transcript, $1, is an alist from line numbers
> (starting from zero) to execution counts.
>
> Converting the relevant coverage-data object into LCOV data via
> `coverage-data->lcov', as advertised in (info "(guile) Code
> Coverage"), then to HTML via LCOV's genhtml(1), will result in the
> relevant line being colored red and contribute negatively to the total
> line-coverage percentage.
>
> === BEGIN TRANSCRIPT ===
> $ cat /tmp/test.scm  
> (define (tail-call-test)
>   (display "foo\n")
>   (tail-call-target))
>
> (define (tail-call-target)
>   (display "bar\n"))
> $ guile              
> GNU Guile 2.0.9.20-10454
> Copyright (C) 1995-2013 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> (begin
> ...   (load "/tmp/test.scm")
> ...   (call-with-values
> ...       (lambda ()
> ...         ((@ (system vm coverage) with-code-coverage)
> ...          ((@ (system vm vm) the-vm))
> ...          tail-call-test))
> ...     (lambda (data . values)
> ...       ((@ (system vm coverage) line-execution-counts) data "/tmp/test.scm"))))
> ;;; <stdin>:0:4095: warning: possibly unbound variable `tail-call-test'
> foo
> bar
> $1 = ((5 . 1) (4 . 1) (2 . 0) (1 . 1) (0 . 1))
> scheme@(guile-user)> 
> === END TRANSCRIPT ===




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Jul 2016 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.