unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Trying to understand trace limit
@ 2020-09-28 17:06 Dave Musicant
  2020-10-03  7:15 ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Musicant @ 2020-09-28 17:06 UTC (permalink / raw)
  To: guile-user

Hi all,

I'm seeing some strange behavior with tracing code, which I'd love some 
help understanding. I've boiled it down to the following simplified example:

(define count
   (lambda (n)
     (if (equal? n 1) 1
         (+ 1 (count (- n 1))))))

,tr (count 92)


When I run the above code (in a fresh Guile instance, via redirecting 
from a file), the trace runs to completion.

However, when I run this version of the code from a file, which runs the 
function twice...

(define count
   (lambda (n)
     (if (equal? n 1) 1
         (+ 1 (count (- n 1))))))

,tr (count 10)   ; runs to completion
,tr (count 92)   ; dies mid-trace


... then the trace dies when it runs the second time, in something that 
must be some sort of stack overflow, though the error is fairly cryptic:

While executing meta-command:
In procedure +: Wrong type argument in position 1: #<unspecified>

What's happening from a memory perspective where tracing the code the 
first time affects how much memory is available for the second time? It 
seems that the first run shouldn't affect the stack limit of the second, 
but something is going on.

Thanks for the help.
Dave



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to understand trace limit
  2020-09-28 17:06 Trying to understand trace limit Dave Musicant
@ 2020-10-03  7:15 ` Aleix Conchillo Flaqué
  2020-10-03 20:39   ` Dave Musicant via General Guile related discussions
  0 siblings, 1 reply; 4+ messages in thread
From: Aleix Conchillo Flaqué @ 2020-10-03  7:15 UTC (permalink / raw)
  To: Dave Musicant; +Cc: guile-user

Hi Dave,

On Mon, Sep 28, 2020 at 10:06 AM Dave Musicant <dmusicant@carleton.edu>
wrote:

> Hi all,
>
> I'm seeing some strange behavior with tracing code, which I'd love some
> help understanding. I've boiled it down to the following simplified
> example:
>
> (define count
>    (lambda (n)
>      (if (equal? n 1) 1
>          (+ 1 (count (- n 1))))))
>
> ,tr (count 92)
>
>
> When I run the above code (in a fresh Guile instance, via redirecting
> from a file), the trace runs to completion.
>
> However, when I run this version of the code from a file, which runs the
> function twice...
>
> (define count
>    (lambda (n)
>      (if (equal? n 1) 1
>          (+ 1 (count (- n 1))))))
>
> ,tr (count 10)   ; runs to completion
> ,tr (count 92)   ; dies mid-trace
>
>
> ... then the trace dies when it runs the second time, in something that
> must be some sort of stack overflow, though the error is fairly cryptic:
>
> While executing meta-command:
> In procedure +: Wrong type argument in position 1: #<unspecified>
>
> What's happening from a memory perspective where tracing the code the
> first time affects how much memory is available for the second time? It
> seems that the first run shouldn't affect the stack limit of the second,
> but something is going on.
>
> Thanks for the help.
> Dave
>

I've tried it with Guile 3.0.4 (in macOS) and I didn't get this error. What
version of Guile and OS are you using?

Aleix


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to understand trace limit
  2020-10-03  7:15 ` Aleix Conchillo Flaqué
@ 2020-10-03 20:39   ` Dave Musicant via General Guile related discussions
  2020-10-05 18:47     ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Musicant via General Guile related discussions @ 2020-10-03 20:39 UTC (permalink / raw)
  To: Aleix Conchillo Flaqué; +Cc: guile-user

I'm using Guile 2.2.7, under Ubuntu 20.04.


--
Dave

On 10/3/20 2:15 AM, Aleix Conchillo Flaqué wrote:
>
> Hi Dave,
>
> On Mon, Sep 28, 2020 at 10:06 AM Dave Musicant <dmusicant@carleton.edu 
> <mailto:dmusicant@carleton.edu>> wrote:
>
>     Hi all,
>
>     I'm seeing some strange behavior with tracing code, which I'd love
>     some
>     help understanding. I've boiled it down to the following
>     simplified example:
>
>     (define count
>        (lambda (n)
>          (if (equal? n 1) 1
>              (+ 1 (count (- n 1))))))
>
>     ,tr (count 92)
>
>
>     When I run the above code (in a fresh Guile instance, via redirecting
>     from a file), the trace runs to completion.
>
>     However, when I run this version of the code from a file, which
>     runs the
>     function twice...
>
>     (define count
>        (lambda (n)
>          (if (equal? n 1) 1
>              (+ 1 (count (- n 1))))))
>
>     ,tr (count 10)   ; runs to completion
>     ,tr (count 92)   ; dies mid-trace
>
>
>     ... then the trace dies when it runs the second time, in something
>     that
>     must be some sort of stack overflow, though the error is fairly
>     cryptic:
>
>     While executing meta-command:
>     In procedure +: Wrong type argument in position 1: #<unspecified>
>
>     What's happening from a memory perspective where tracing the code the
>     first time affects how much memory is available for the second
>     time? It
>     seems that the first run shouldn't affect the stack limit of the
>     second,
>     but something is going on.
>
>     Thanks for the help.
>     Dave
>
>
> I've tried it with Guile 3.0.4 (in macOS) and I didn't get this error. 
> What version of Guile and OS are you using?
>
> Aleix
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to understand trace limit
  2020-10-03 20:39   ` Dave Musicant via General Guile related discussions
@ 2020-10-05 18:47     ` Aleix Conchillo Flaqué
  0 siblings, 0 replies; 4+ messages in thread
From: Aleix Conchillo Flaqué @ 2020-10-05 18:47 UTC (permalink / raw)
  To: Dave Musicant; +Cc: guile-user

It seems like a bug in 2.2.7 (or even 2.x). I can only suggest reporting it
to bug-guile@gnu.org and guile-devel@gnu.org and update to Guile 3.x.

Aleix

On Sat, Oct 3, 2020 at 1:39 PM Dave Musicant <dmusicant@carleton.edu> wrote:

> I'm using Guile 2.2.7, under Ubuntu 20.04.
>
>
> --
> Dave
>
> On 10/3/20 2:15 AM, Aleix Conchillo Flaqué wrote:
>
>
> Hi Dave,
>
> On Mon, Sep 28, 2020 at 10:06 AM Dave Musicant <dmusicant@carleton.edu>
> wrote:
>
>> Hi all,
>>
>> I'm seeing some strange behavior with tracing code, which I'd love some
>> help understanding. I've boiled it down to the following simplified
>> example:
>>
>> (define count
>>    (lambda (n)
>>      (if (equal? n 1) 1
>>          (+ 1 (count (- n 1))))))
>>
>> ,tr (count 92)
>>
>>
>> When I run the above code (in a fresh Guile instance, via redirecting
>> from a file), the trace runs to completion.
>>
>> However, when I run this version of the code from a file, which runs the
>> function twice...
>>
>> (define count
>>    (lambda (n)
>>      (if (equal? n 1) 1
>>          (+ 1 (count (- n 1))))))
>>
>> ,tr (count 10)   ; runs to completion
>> ,tr (count 92)   ; dies mid-trace
>>
>>
>> ... then the trace dies when it runs the second time, in something that
>> must be some sort of stack overflow, though the error is fairly cryptic:
>>
>> While executing meta-command:
>> In procedure +: Wrong type argument in position 1: #<unspecified>
>>
>> What's happening from a memory perspective where tracing the code the
>> first time affects how much memory is available for the second time? It
>> seems that the first run shouldn't affect the stack limit of the second,
>> but something is going on.
>>
>> Thanks for the help.
>> Dave
>>
>
> I've tried it with Guile 3.0.4 (in macOS) and I didn't get this error.
> What version of Guile and OS are you using?
>
> Aleix
>
>
>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-05 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 17:06 Trying to understand trace limit Dave Musicant
2020-10-03  7:15 ` Aleix Conchillo Flaqué
2020-10-03 20:39   ` Dave Musicant via General Guile related discussions
2020-10-05 18:47     ` Aleix Conchillo Flaqué

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).