[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more
From: |
Wolfgang J Moeller |
Subject: |
guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more |
Date: |
Wed, 9 Mar 2011 11:53:38 +0100 (CET) |
Hi there,
while essentially all of my "old" guile works with 2.0.0,
I found a bug when testing CALL-WITH-PROMPT . Also some
more quibbles further below.
The major bug:
With self-compiled GUILE 2.0.0 (as of 2011-02-16) on OpenSuSE 11.1 -
both 32-bit and 64-bit - built/installed and then renamed "guile2",
I observe a segfault when done loading a particular compiled file.
No such error in interpreted mode.
Details:
address@hidden uname -a
Linux linux3 2.6.27.56-0.1-pae #1 SMP 2010-12-01 16:57:58 +0100 i686 i686 i386
GNU/Linux
address@hidden build-aux/config.guess
i686-pc-linux-gnu
address@hidden uname -a
Linux louix 2.6.27.56-0.1-default #1 SMP 2010-12-01 16:57:58 +0100 x86_64
x86_64 x86_64 GNU/Linux
address@hidden ./guile-2.0.0/build-aux/config.guess
x86_64-unknown-linux-gnu
Unfortunately, I did "make distclean", so no "config.status'.
Anyway, I installed on either machine via
./configure && make; su -c 'make install'
(no options) the following packages:
gc-7.1
libffi-3.0.9
libunistring-0.9.3
guile-2.0.0
===============================================================================
Transcript of session (same on 64-bit)
===============================================================================
address@hidden guile2 -q --no-auto-compile
GNU Guile 2.0.0
Copyright (C) 1995-2011 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)> (load "/home/moeller/scm/g2crash.scm")
#t ; <-- #t
scheme@(guile-user)> ,cc /home/moeller/scm/g2crash.scm
scheme@(guile-user)> (load "/home/moeller/scm/g2crash.scm")
#t ; <-- #t
Segmentation fault
address@hidden
==============================================================================
File "/home/moeller/scm/g2crash.scm"
==============================================================================
;;; -*- scheme -*-
;;
;;; try reset & shift with GUILE V2 prompts
;;
;;
(define-syntax reset
(syntax-rules ()
((_ . body)
(call-with-prompt 'Reset
(lambda () . body)
(lambda (cont f) (f cont))))))
;;
(define-syntax shift
(syntax-rules ()
((_ var . body)
(abort-to-prompt 'Reset
(lambda (cont)
((lambda (var) (reset . body))
(lambda vals (reset (apply cont vals)))))))))
;;
;;
(define (reset* thunk)
(reset (thunk)))
;;
(define (shift* fc)
(shift c (fc c)))
;;
;; ------------------------------- Tests
;;
;;(display (+ 10 (reset (+ 2 (shift k (+ 100 (k (k 3))))))))
;;(display " ; <-- 117")
;;(newline)
;;
;;(display (* 10 (reset (* 2 (shift g (* 5 (shift f (+ (f 1) 1))))))))
;;(display " ; <-- 60")
;;(newline)
;;
;;(display (let ((f (lambda (x) (shift k (k (k x))))))
;; (+ 1 (reset (+ 10 (f 100))))))
;;(display " ; <-- 121")
;;(newline)
;;
;;;; shift f1 tests that we implement shift rather than shift0
;;(display (reset
;; (let ((x (shift f
;; (shift f1 (f1 (cons 'a (f '())))))))
;; (shift g x))))
;;(display " ; <-- '(a)")
;;(newline)
(reset (display (let ((x 'abcde)) (eq? x ((shift* shift*) x)))))
(display " ; <-- #t")
(newline)
;;(let
;; ((traverse
;; (lambda (xs)
;; (letrec ((visit
;; (lambda (xs)
;; (if (null? xs)
;; '()
;; (visit (shift*
;; (lambda (k)
;; (cons (car xs) (k (cdr xs))))))))))
;; (reset*
;; (lambda ()
;; (visit xs)))))))
;;
;; (display "Example by Olivier Danvy: ")
;; (display (traverse '(1 2 3 4 5)))
;; (display " ; <-- '(1 2 3 4 5)")
;; (newline)
;;)
;;;*
===============================================================================
===============================================================================
Another *strange* mis-behaviour, discovered while running with "-q":
(load <filename>) accepts relative paths only after (activate-readline), or so
...
The three commands that I'm typing in the following session
traditionally make up my "~/.guile".
===============================================================================
Transcript of session
===============================================================================
address@hidden guile2 -q --no-auto-compile
GNU Guile 2.0.0
Copyright (C) 1995-2011 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)> (load "g2crash.scm")
ERROR: In procedure primitive-load-path:
ERROR: In procedure primitive-load-path: Unable to find file "./g2crash.scm" in
load path
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ^D
scheme@(guile-user)> (use-modules (ice-9 r5rs))
scheme@(guile-user)> (load "g2crash.scm")
ERROR: In procedure primitive-load-path:
ERROR: In procedure primitive-load-path: Unable to find file "./g2crash.scm" in
load path
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ^D
scheme@(guile-user)> (use-modules (ice-9 readline))
scheme@(guile-user)> (load "g2crash.scm")
ERROR: In procedure primitive-load-path:
ERROR: In procedure primitive-load-path: Unable to find file "./g2crash.scm" in
load path
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ^D
scheme@(guile-user)> (activate-readline)
scheme@(guile-user)> (load "g2crash.scm")
#t ; <-- #t
scheme@(guile-user)>
address@hidden
===============================================================================
===============================================================================
Wishlist:
(1) Please provide a means by which the debugger prompt (recursive REPL)
can be turned off/on. Both a 'hook' (like COMMON-LISP:DEBUGGER-HOOK
plus COMMON-LISP:ABORT) or a REPL command would be OK with me.
I mis-type too often!
[Anyway, I could not find such a means in 2.0.0].
(2) Please provide some obvious "undefine" command, since UNINTERN is
gone.
I'd need it only interactively, so a REPL command would be fine.
Primary use, of course, would be to remove syntax definitions -
alternating between syntax-based and procedure-based code
ought not require a re-start of GUILE.
[I believe that the effect still can be had via un-obvious use
of 'deprecated' APIs].
Best regards,
Wolfgang J. Moeller, Tel. +49 551 47361, wjm<AT>heenes.com
37085 Goettingen, Germany | Disclaimer: No claim intended!
http://www.wjmoeller.de/ -+-------- http://www.heenes.com/
- guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more,
Wolfgang J Moeller <=
- Re: guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more, Andy Wingo, 2011/03/11
- Re: guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more, Andy Wingo, 2011/03/14
- Re: guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more, Andy Wingo, 2011/03/15
- shift and reset in ice-9 control, Andy Wingo, 2011/03/17