unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Mysterious bug in master
@ 2015-01-10 16:30 Stefan Israelsson Tampe
  2015-01-11 12:30 ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Israelsson Tampe @ 2015-01-10 16:30 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

Hi, esp. wingo

Here is the defenition and uses of *freeze-map* in my file parse.scm,

(define *freeze-map*   (make-fluid (make-hash-table)))
(define (clear-tokens)
  (fluid-set! *freeze-map* (make-hash-table)))
(clear-tokens)

 (let ((val (hash-ref (pk 'freeze (fluid-ref *freeze-map*))
                             (cons* N M tok) #f))

     ...)

 (hash-set! (fluid-ref *freeze-map*)
                               (cons* n m tok) (list X XL N M XX ... val2)))

 (hash-set! (fluid-ref *freeze-map*)
                               (cons* n m tok) val2))

 (with-fluids ((*freeze-map* (pk 22 (fluid-ref *freeze-map*))))
      (clear-tokens)


sometimes this fails sometimes not when using the code e.g.
;;; (freeze (#f . #(() () () () () () () () () () () () () () () () () ()
() () () () () () () () () () () () ())))
ERROR: In procedure hash-ref:

Sometimes when I comile with a change of whitespaces I can make the code
run else I get
this mysterious error. This is a clue that there might be a bug in 2.1,
guile-log is a bit naughty
so I don't want to put the blame on guile, just hint that there might be a
fundamental bug in there

I tracked it down to the clear-tokens function, that ,x clear-tokens
assembly is
  0    (assert-nargs-ee/locals 1 3)    ;; 0 args, 3 locals   at
logic/guile-log/parser.scm:64:0
   1    (toplevel-box 0 57143 36139 36137 #t);; `*freeze-map*'
   6    (box-ref 0 0)
   7    (toplevel-box 1 57139 36133 36121 #t);; `make-hash-table'
  12    (box-ref 3 1)
  13    (call 3 1)                                            at
logic/guile-log/parser.scm:65:27
  15    (receive 1 3 4)
  17    (module-box 2 41407 34463 41405 #t);; `(@@ (guile) fluid-set!)'
  22    (box-ref 2 2)                                         at
logic/guile-log/parser.scm:65:2
  23    (mov 3 2)
  24    (mov 2 1)
  25    (mov 1 0)
  26    (mov 0 3)
  27    (tail-call 3)

I'm wondering if the receive value 4 is protected by the frame that is the
return of make-hash-table.

Regards
Stefan

[-- Attachment #2: Type: text/html, Size: 3091 bytes --]

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

* Re: Mysterious bug in master
  2015-01-10 16:30 Mysterious bug in master Stefan Israelsson Tampe
@ 2015-01-11 12:30 ` Stefan Israelsson Tampe
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Israelsson Tampe @ 2015-01-11 12:30 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2545 bytes --]

I did investigate this further,

It looks like a gc bug that tag for hashtable is replaced by #f and
therefore you get (#f . #(() ....))
I did run this several times and sometimes it ran fine and sometimes you
got this issue.

Is there any specific versions of the gc that must be used and is demanded
by guile-2.1 master?

Regards
Stefan




On Sat, Jan 10, 2015 at 5:30 PM, Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

> Hi, esp. wingo
>
> Here is the defenition and uses of *freeze-map* in my file parse.scm,
>
> (define *freeze-map*   (make-fluid (make-hash-table)))
> (define (clear-tokens)
>   (fluid-set! *freeze-map* (make-hash-table)))
> (clear-tokens)
>
>  (let ((val (hash-ref (pk 'freeze (fluid-ref *freeze-map*))
>                              (cons* N M tok) #f))
>
>      ...)
>
>  (hash-set! (fluid-ref *freeze-map*)
>                                (cons* n m tok) (list X XL N M XX ...
> val2)))
>
>  (hash-set! (fluid-ref *freeze-map*)
>                                (cons* n m tok) val2))
>
>  (with-fluids ((*freeze-map* (pk 22 (fluid-ref *freeze-map*))))
>       (clear-tokens)
>
>
> sometimes this fails sometimes not when using the code e.g.
> ;;; (freeze (#f . #(() () () () () () () () () () () () () () () () () ()
> () () () () () () () () () () () () ())))
> ERROR: In procedure hash-ref:
>
> Sometimes when I comile with a change of whitespaces I can make the code
> run else I get
> this mysterious error. This is a clue that there might be a bug in 2.1,
> guile-log is a bit naughty
> so I don't want to put the blame on guile, just hint that there might be a
> fundamental bug in there
>
> I tracked it down to the clear-tokens function, that ,x clear-tokens
> assembly is
>   0    (assert-nargs-ee/locals 1 3)    ;; 0 args, 3 locals   at
> logic/guile-log/parser.scm:64:0
>    1    (toplevel-box 0 57143 36139 36137 #t);; `*freeze-map*'
>    6    (box-ref 0 0)
>    7    (toplevel-box 1 57139 36133 36121 #t);; `make-hash-table'
>   12    (box-ref 3 1)
>   13    (call 3 1)                                            at
> logic/guile-log/parser.scm:65:27
>   15    (receive 1 3 4)
>   17    (module-box 2 41407 34463 41405 #t);; `(@@ (guile) fluid-set!)'
>   22    (box-ref 2 2)                                         at
> logic/guile-log/parser.scm:65:2
>   23    (mov 3 2)
>   24    (mov 2 1)
>   25    (mov 1 0)
>   26    (mov 0 3)
>   27    (tail-call 3)
>
> I'm wondering if the receive value 4 is protected by the frame that is the
> return of make-hash-table.
>
> Regards
> Stefan
>
>
>

[-- Attachment #2: Type: text/html, Size: 4014 bytes --]

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

end of thread, other threads:[~2015-01-11 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-10 16:30 Mysterious bug in master Stefan Israelsson Tampe
2015-01-11 12:30 ` Stefan Israelsson Tampe

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