unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Luca Saiu <positron@gnu.org>
Cc: bug-guile@gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: Likely bug: SMOBs and mark functions [Was: Re: [bug #30480] VM: load looks for files in the wrong directory]
Date: Tue, 15 Feb 2011 12:59:14 +0100	[thread overview]
Message-ID: <4D5A6A92.1080702@gnu.org> (raw)
In-Reply-To: <20110213-185123.sv20118.98931@savannah.gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/13/2011 07:51 PM, Andy Wingo wrote:
> Update of bug #30480 (project guile):
> Fixed, by turning load into a macro that expands to a call to
> load-in-vicinity.  Nasty or awesome?  We report, you decide!

Awesome :-).  This solves the load problem in my old testcase, but
testing the new version helped me to expose another problem.

My code uses SMOBs with explicit GC mark funcions, as it was written for
Guile 1.8; seeing a segmentation fault occurring only in 1.9 made me
suspect of some mistake of mine, related to using SMOBs in some unsafe
way; but now I find this unlikely, and I think it's a real bug.

I've reproduced the problem by using the example in
  doc/example-smob/
which is much simpler than my own code; the failure is identical.

[luca@optimum
~/projects-by-others/guile-from-git-mainline/doc/example-smob]$ ./myguile
GNU Guile 1.9.15.114-b81eb
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)> make-image
$1 = #<procedure make-image (_ _ _)>
scheme@(guile-user)> (define i (make-image "Whistler's Mother" 100 100))
scheme@(guile-user)> i
$2 = #<image Whistler's Mother>
scheme@(guile-user)> (gc)
scheme@(guile-user)> (gc)
The current thread is at (nil); Segmentation fault

gdb says that the problem is in smob.c, in the smob_mark function:
      SCM_I_CURRENT_THREAD->current_mark_stack_ptr = mark_stack_ptr;
A quick printf showed me that the SCM_I_CURRENT_THREAD macro returned NULL.

This happens on an x86_64 GNU/Linux machine, guile from today's git; 1.8
doesn't crash.

Thanks.  2.0 will seriously rock :-).

- -- 
Luca Saiu
http://www-lipn.univ-paris13.fr/~saiu
GNU epsilon: http://www.gnu.org/software/epsilon
Marionnet:   http://www.marionnet.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1aapIACgkQvzOavibF0ob0rgCdHiCCyk58RxY/B1/JqHXZSlcj
CdgAn1Vo0hP/l0cgNPgZ+ei/tKaPSoQH
=PDrt
-----END PGP SIGNATURE-----



  reply	other threads:[~2011-02-15 11:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 22:51 [bug #30480] VM: load looks for files in the wrong directory Luca Saiu
2010-07-18 22:54 ` Luca Saiu
2010-07-18 22:59   ` Luca Saiu
2010-07-24 16:16     ` Ludovic Courtès
2011-02-13 18:51       ` Andy Wingo
2011-02-15 11:59         ` Luca Saiu [this message]
2011-02-15 12:08           ` Likely bug: SMOBs and mark functions [Was: Re: [bug #30480] VM: load looks for files in the wrong directory] Luca Saiu
2011-02-15 15:38           ` Ludovic Courtès
2011-02-15 16:17             ` Luca Saiu
2011-02-16 13:23               ` Ludovic Courtès
2011-02-17  9:41                 ` Luca Saiu
2011-02-17 11:13                   ` Likely bug: SMOBs and mark functions Andy Wingo
2011-02-17 14:08                     ` Luca Saiu

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=4D5A6A92.1080702@gnu.org \
    --to=positron@gnu.org \
    --cc=bug-guile@gnu.org \
    --cc=ludo@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).