unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more
@ 2011-03-09 10:53 Wolfgang J Moeller
  2011-03-11 20:02 ` Andy Wingo
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Wolfgang J Moeller @ 2011-03-09 10:53 UTC (permalink / raw)
  To: bug-guile

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:

moeller@linux3-$ 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
moeller@linux3-$ build-aux/config.guess
i686-pc-linux-gnu

moeller@louix-$ 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
moeller@louix-$ ./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)
===============================================================================
moeller@linux3-$ 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
moeller@linux3-$
==============================================================================
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
===============================================================================
moeller@linux3-$ 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)>
moeller@linux3-$
===============================================================================
===============================================================================

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/



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

end of thread, other threads:[~2011-04-12 13:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 10:53 guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more Wolfgang J Moeller
2011-03-11 20:02 ` Andy Wingo
2011-03-14 20:51 ` Andy Wingo
2011-03-14 22:00   ` Andy Wingo
2011-03-15 22:56 ` Andy Wingo
2011-03-17 10:53 ` shift and reset in ice-9 control Andy Wingo
2011-03-21  1:31   ` Wolfgang J Moeller
2011-03-30 14:56     ` Andy Wingo
2011-04-02 14:40       ` Wolfgang J Moeller
2011-04-12  9:51         ` Andy Wingo
2011-04-12 13:11           ` Wolfgang J Moeller

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