unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Prafulla Giri <pratheblackdiamond@gmail.com>
To: 42574@debbugs.gnu.org
Subject: bug#42574: Probable (system vm trace) bug
Date: Sat, 1 Aug 2020 18:50:38 +0545	[thread overview]
Message-ID: <CAFw+=j3aCJ_HbU5uM1mv1Vb1RC9zVXPO4iKM5t4WhYnx-BbNiQ@mail.gmail.com> (raw)
In-Reply-To: <CAFw+=j0kzmAQpHLKSm9vuShvK9TMmSaGtZsTqK+Ui-FGUFj8=Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3172 bytes --]

Attached is a patch to fix this issue. I would like to acknowledge
RhodiumToad, who actually figured out what was causing this issue.

On Tue, Jul 28, 2020 at 3:23 PM Prafulla Giri <pratheblackdiamond@gmail.com>
wrote:

> Esteemed Maintainers,
>
> I am quite positive that what I am experiencing is not quite a bug but
> just some mis-step on my part. But I have been encouraged to report this as
> a possible bug. Thus, here it is.
>
> Context:
> Guile version: 3.0.2 (installed using guix)
> Loaded Files: simply.scm (
> https://github.com/hosoe-masaki/SimplyScheme/blob/master/simply.scm)
> Reverse function (referred to in the report, assumes 'simply.scm' has been
> loaded):
> (define (reverse wd) (if (equal? wd "") "" (word (reverse (bf wd)) (first
> wd))))
> ;; (reverse 'asdf) -> 'fdsa
>
> This started with my first wanting to run a (trace) of a recursive
> procedure as seen in Chapter 13 of the book 'Simply Scheme' (
> https://people.eecs.berkeley.edu/~bh/ssch13/convince-recur.html). I
> looked for a waay to (trace) in guile, but couldn't find anything except
> ,trace, which was giving a trace of everything that the function (reverse)
> called from inside of it, thus making the trace 'polluted'.
>
> I then looked around and found that a (trace) function, much like the one
> being demonstrated in the book used to exist once in guile:
> https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Tracing.html
> and then found that for guile3 there was something that looked similarly
> promising: the (trace-calls-to-procedure) function (
> https://www.gnu.org/software/guile/docs/master/guile.html/Tracing-Traps.html).
> However,
> > (trace-calls-to-procedure reverse)
> > (reverse 'asdf)
> fdsa
> produced no trace. This led me to ask around IRC for some guidance
> regarding it. Someone from #emacs suggested I try doing this:
> http://ix.io/2suZ
> When I attempted to do the same thing, however, I encountered the
> following error, at the sight of which, it was recommended that I file a
> (possible) bug report: https://termbin.com/6nm5
>
> The following `script` typescript might also be of interest to the
> maintainers (to be replayed using `scriptreplay`):
> typescript - https://termbin.com/sx5o
> timing file - https://termbin.com/73ei
> (This one records the (call-with-trace) call with both #:call? #f and
> without the specification).
>
> I must confess, I don't understand a whole lot of this. All I would like
> to say is that I have a feeling (trace-calls-to-procedure procedure)
> should have worked like (trace) as shown in chapter 13 section 'trace' in
> the book (https://people.eecs.berkeley.edu/~bh/ssch13/convince-recur.html);
> it just seems 'right' by the name of it. I was expecting the trace from (trace-call-to-procedure
> reverse) (reverse 'asdf) to be basically like ,trace (reverse 'asdf) but
> without the traces of all other procedures.
>
> Please do let me know if I have left out any important details. And please
> do let me know if I am doing something wrong here. I am almost quite
> certain this is just a minor error on my part, rather than a bug (and I'd
> really like to be able to trace those procedures).
>

[-- Attachment #1.2: Type: text/html, Size: 5792 bytes --]

[-- Attachment #2: 0001-Fix-return-handler-of-trace-calls-to-procedure.patch --]
[-- Type: text/x-patch, Size: 1332 bytes --]

From c907e9f7ecc4764f6cdcf5f6b2cd6ced80ad95a9 Mon Sep 17 00:00:00 2001
From: Prafulla Giri <pratheblackdiamond@gmail.com>
Date: Sat, 1 Aug 2020 15:39:22 +0545
Subject: [PATCH] Fix return-handler of trace-calls-to-procedure

This change removes the extra/unused formal parameter 'values' from
the definition of return-handler in trace-calls-to-procedure. This
extra parameter was causing trace-calls-to-procedure to fail for the
lack of an argument that was never passed to it. Thanks to Mr. Andrew
(RhodiumToad) for figuring this out. Fixes #42574.

* module/system/vm/trace.scm (trace-calls-to-procedure (return-handler)):
  Remove unnecessary formal parameter 'values'.
---
 module/system/vm/trace.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/system/vm/trace.scm b/module/system/vm/trace.scm
index e9f17dae8..54840d8fd 100644
--- a/module/system/vm/trace.scm
+++ b/module/system/vm/trace.scm
@@ -73,7 +73,7 @@
                                    (max-indent (- width 40)))
   (define (apply-handler frame depth)
     (print-application frame depth width prefix max-indent))
-  (define (return-handler frame depth values)
+  (define (return-handler frame depth)
     (print-return frame depth width prefix max-indent))
   (trap-calls-to-procedure proc apply-handler return-handler))
 
-- 
2.26.2


  parent reply	other threads:[~2020-08-01 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  9:38 bug#42574: Probable (system vm trace) bug Prafulla Giri
2020-07-29 15:04 ` bug#42574: Permanent Records Prafulla Giri
2020-08-01 13:05 ` Prafulla Giri [this message]
2021-05-21 18:38 ` bug#42574: Probable (system vm trace) bug lloda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFw+=j3aCJ_HbU5uM1mv1Vb1RC9zVXPO4iKM5t4WhYnx-BbNiQ@mail.gmail.com' \
    --to=pratheblackdiamond@gmail.com \
    --cc=42574@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).