bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Likely bug: SMOBs and mark functions [Was: Re: [bug #30480] VM: load loo


From: Luca Saiu
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
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10

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

address@hidden
~/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 via email to

[Prev in Thread] Current Thread [Next in Thread]