From unknown Sat Aug 09 20:50:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14849: (system vm coverage) `line-execution-counts' misleading output Resent-From: taylanbayirli@gmail.com (Taylan Ulrich B.) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 12 Jul 2013 14:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14849 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 14849@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.137364044612484 (code B ref -1); Fri, 12 Jul 2013 14:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2013 14:47:26 +0000 Received: from localhost ([127.0.0.1]:50520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxed3-0003FG-Dg for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36816) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxed1-0003Eu-4o for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxecq-0003vO-4c for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecp-0003vK-VU for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecm-0004oG-Hs for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxecj-0003sD-AG for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:08 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:53789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecj-0003rV-4B for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:05 -0400 Received: by mail-ea0-f171.google.com with SMTP id m14so6421342eaj.2 for ; Fri, 12 Jul 2013 07:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:subject; bh=ih/HcvOZsn6wR00yaVYuZ5QTUbuKgdFi0j2Ta6+BLB0=; b=Si1RrFTmdZ6jOb+dJXlmy6MKqPS9UwGZSFgulwn/1qCwyD3NlBCy3GYfW99d4FYS09 BKvzPNd5ggKjMfyIBvbcXLqA+48zR98l4h+9fg7lFt6LXM54rmsyhTY1Q8r6uKmf4ODe w1gdCu4DsQsod0YhQjTJi63dnfW8c01J2l6uCNnh16mHyFC5q5Np3GZ7KuuFyuyS0tgN eTJZN6JmNKgEuaz+UbWWHAK9+1t6nLDp1+wHfDa1pc7QcxpB7O5rNowjCehfO94AXCBN 6d2d9CXjYuW9hhxxVet/L5kRlFekdD1klfOZah4OJRmrYQpXDn6oMH2a/N8Okevybdd4 8mfQ== X-Received: by 10.15.45.194 with SMTP id b42mr47754388eew.51.1373640423734; Fri, 12 Jul 2013 07:47:03 -0700 (PDT) Received: from taylan.uni.cx (p4FD9238B.dip0.t-ipconnect.de. [79.217.35.139]) by mx.google.com with ESMTPSA id n45sm79005855eew.1.2013.07.12.07.47.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 07:47:03 -0700 (PDT) Date: Fri, 12 Jul 2013 16:47:00 +0200 Message-Id: <8761wfal97.fsf@taylan.uni.cx> From: taylanbayirli@gmail.com (Taylan Ulrich B.) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) 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")))) ;;; :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 === From unknown Sat Aug 09 20:50:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: taylanbayirli@gmail.com (Taylan Ulrich B.) Subject: bug#14849: closed (Re: bug#14849: (system vm coverage) `line-execution-counts' misleading output) Message-ID: References: <877fdj588h.fsf@pobox.com> <8761wfal97.fsf@taylan.uni.cx> X-Gnu-PR-Message: they-closed 14849 X-Gnu-PR-Package: guile Reply-To: 14849@debbugs.gnu.org Date: Tue, 21 Jun 2016 07:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1466493002-2496-1" This is a multi-part message in MIME format... ------------=_1466493002-2496-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #14849: (system vm coverage) `line-execution-counts' misleading output which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 14849@debbugs.gnu.org. --=20 14849: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D14849 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1466493002-2496-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 14849-done) by debbugs.gnu.org; 21 Jun 2016 07:09:14 +0000 Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFFo9-0000dA-VH for submit@debbugs.gnu.org; Tue, 21 Jun 2016 03:09:14 -0400 Received: from pb-sasl2.pobox.com ([64.147.108.67]:53176 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFFo8-0000d3-U2 for 14849-done@debbugs.gnu.org; Tue, 21 Jun 2016 03:09:13 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 7515E2088D; Tue, 21 Jun 2016 03:09:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=Wh9Z27u/X9BjLj6RmTyLrklrHS8=; b=P5bsKx 4wQgJFKoxFboOgJ9kygW7zIk2khPZtBKhSqbnXMfl94VBi1GsLNUUltiNLnk9cre hri0aiASaYCnEhTJ5/t7jxv8dpyO1D2OkwYL3gKv1lTXbO4uUWHhPV+JcqHn3o1K wPPruA73Bqf3oVyx4JxKpzIzOgfjDZFVPy2NU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=HIVpfu+N7oj7RuTAhkBq/8C2P0eSTfCi S6SZ2CQoPvEAiXrToP3g2A9vNY6fGXqcZxWibAfEE+B07YzhFGgygMLhrx5/ZuGp rbXOMXLy6f10/lf8SUJS32seCTI+UCIak+ExRPjAcECHVPRc6mXTr9KiAaVD5wcu bngsjJi3Rwg= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 6DA782088C; Tue, 21 Jun 2016 03:09:10 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 858092088B; Tue, 21 Jun 2016 03:09:09 -0400 (EDT) From: Andy Wingo To: taylanbayirli@gmail.com (Taylan Ulrich B.) Subject: Re: bug#14849: (system vm coverage) `line-execution-counts' misleading output References: <8761wfal97.fsf@taylan.uni.cx> Date: Tue, 21 Jun 2016 09:09:02 +0200 In-Reply-To: <8761wfal97.fsf@taylan.uni.cx> (Taylan Ulrich B.'s message of "Fri, 12 Jul 2013 16:47:00 +0200") Message-ID: <877fdj588h.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 0CE89A5E-377F-11E6-8604-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 14849-done Cc: 14849-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) 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@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")))) > ;;; :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 === ------------=_1466493002-2496-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Jul 2013 14:47:26 +0000 Received: from localhost ([127.0.0.1]:50520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxed3-0003FG-Dg for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36816) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxed1-0003Eu-4o for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxecq-0003vO-4c for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecp-0003vK-VU for submit@debbugs.gnu.org; Fri, 12 Jul 2013 10:47:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecm-0004oG-Hs for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxecj-0003sD-AG for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:08 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:53789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxecj-0003rV-4B for bug-guile@gnu.org; Fri, 12 Jul 2013 10:47:05 -0400 Received: by mail-ea0-f171.google.com with SMTP id m14so6421342eaj.2 for ; Fri, 12 Jul 2013 07:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:subject; bh=ih/HcvOZsn6wR00yaVYuZ5QTUbuKgdFi0j2Ta6+BLB0=; b=Si1RrFTmdZ6jOb+dJXlmy6MKqPS9UwGZSFgulwn/1qCwyD3NlBCy3GYfW99d4FYS09 BKvzPNd5ggKjMfyIBvbcXLqA+48zR98l4h+9fg7lFt6LXM54rmsyhTY1Q8r6uKmf4ODe w1gdCu4DsQsod0YhQjTJi63dnfW8c01J2l6uCNnh16mHyFC5q5Np3GZ7KuuFyuyS0tgN eTJZN6JmNKgEuaz+UbWWHAK9+1t6nLDp1+wHfDa1pc7QcxpB7O5rNowjCehfO94AXCBN 6d2d9CXjYuW9hhxxVet/L5kRlFekdD1klfOZah4OJRmrYQpXDn6oMH2a/N8Okevybdd4 8mfQ== X-Received: by 10.15.45.194 with SMTP id b42mr47754388eew.51.1373640423734; Fri, 12 Jul 2013 07:47:03 -0700 (PDT) Received: from taylan.uni.cx (p4FD9238B.dip0.t-ipconnect.de. [79.217.35.139]) by mx.google.com with ESMTPSA id n45sm79005855eew.1.2013.07.12.07.47.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 07:47:03 -0700 (PDT) Date: Fri, 12 Jul 2013 16:47:00 +0200 Message-Id: <8761wfal97.fsf@taylan.uni.cx> From: taylanbayirli@gmail.com (Taylan Ulrich B.) To: bug-guile@gnu.org Subject: (system vm coverage) `line-execution-counts' misleading output X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) 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")))) ;;; :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 === ------------=_1466493002-2496-1--