unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: "Jim Pryor" <dubiousjim@gmail.com>
Cc: Amatus <c11h15no2@yahoo.com>, 10235@debbugs.gnu.org
Subject: bug#10235: guile 2.0.3 segfaults on FreeBSD 9
Date: Thu, 22 Dec 2011 10:35:33 -0500	[thread overview]
Message-ID: <87r4zwpqka.fsf@pobox.com> (raw)
In-Reply-To: <1323186803.10347.140661008137717@webmail.messagingengine.com> (Jim Pryor's message of "Tue, 06 Dec 2011 10:53:23 -0500")

Hi Jim,

There are some packaging-specific things in your mail, one bug, and a
few FreeBSD-related things that we should probably fold into Guile.
I'll try to reply only to those things that we need to do in Guile.

On Tue 06 Dec 2011 10:53, "Jim Pryor" <dubiousjim@gmail.com> writes:

>         REINPLACE_FILES=        libguile/smob.c libguile/gc.c \
>                                 libguile/mallocs.c libguile/gc-malloc.c
>
>         post-patch:
>                 @cd ${WRKSRC} ; sed -e 's|<malloc\.h>|<stdlib.h>|g'

I have fixed these files to use stdlib.h instead of malloc.h.

>           GEN    guile-procedures.texi
>         Segmentation fault (core dumped)

That's a problem :)

> And indeed if you just go to the libguile directory and execute the
> build `guile` file manually, you get a segfault. Here is the backtrace:
>
>     #0  0x000000080091f8a5 in scm_c_vm_run () from
>     /usr/obj/usr/ports/lang/guile/work/guile-2.0.3/libguile/.libs/libguile-2.0.so.25
>     [New Thread 802807400 (LWP 104574/guile)]
>     (gdb) bt
>     #0  0x000000080091f8a5 in scm_c_vm_run () from
>     /usr/obj/usr/ports/lang/guile/work/guile-2.0.3/libguile/.libs/libguile-2.0.so.25
>     #1  0x0000000800895e17 in scm_async_click () from
>     /usr/obj/usr/ports/lang/guile/work/guile-2.0.3/libguile/.libs/libguile-2.0.so.25
>     #2  0x00000008008f952f in scm_make_smob_type () from
>     /usr/obj/usr/ports/lang/guile/work/guile-2.0.3/libguile/.libs/libguile-2.0.so.25

Can you get a backtrace with symbols?

Also, once you have built a version with symbols, I would like to see
what is triggering this async, and what the error is.  So if you could
run:

  GUILE_AUTO_COMPILE=0 libtool --mode=execute gdb libguile/guile

and see what happens, that would be great.  You will likely be able to
reproduce this error that way.

> --- ./configure.ac.orig 2011-10-07 19:49:48.000000000 -0400
> +++ ./configure.ac      2011-12-06 09:35:02.484201526 -0500
> @@ -657,7 +657,7 @@
>  #
>  AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h
>  memory.h process.h string.h \
>  regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
> -sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
> +sys/time.h sys/times.h sys/stdtypes.h sys/types.h \
>  sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
>  direct.h langinfo.h nl_types.h machine/fpu.h poll.h sched.h])

Why did you need to do this?

> +#   pthread_np.h - available on FreeBSD

I applied this and the supporting code, with some small changes.
Thanks.  I also applied the itanium patch.

> -#if defined (sparc) || defined (__sparc__) || defined (__sparc)
> +#if (defined (sparc) || defined (__sparc__) || defined (__sparc)) && \
> +    (!defined(__FreeBSD__))
>  # define SCM_FLUSH_REGISTER_WINDOWS asm("ta 3")
>  #else
>  # define SCM_FLUSH_REGISTER_WINDOWS /* empty */

Why is this?

> ----- files/patch-libguile_gen-scmconfig.c -----
> --- libguile/gen-scmconfig.c    2008-02-23 21:38:39.310330888 -0600
> +++ libguile/gen-scmconfig.c    2008-02-23 21:39:32.909873567 -0600
> @@ -123,6 +123,7 @@
>  
>  #include "gen-scmconfig.h"
>  
> +#define _ANSI_SOURCE
>  #include <stdio.h>
>  #include <string.h>
>  

Why is this?

> ----- files/patch-libguile_numbers.c -----
> --- ./libguile/numbers.c.orig   2011-10-10 16:24:38.000000000 -0400
> +++ ./libguile/numbers.c        2011-12-06 05:26:45.391199972 -0500
> @@ -148,7 +148,7 @@
>  
>  
>  #if defined (GUILE_I)
> -#if defined HAVE_COMPLEX_DOUBLE
> +#if defined HAVE_COMPLEX_DOUBLE && (defined HAVE_CLOG || defined
> HAVE_CLOG10 || defined HAVE_CEXP || defined HAVE_USABLE_CSQRT) &&
> defined (SCM_COMPLEX_VALUE) 
>  
>  /* For an SCM object Z which is a complex number (ie. satisfies
>     SCM_COMPLEXP), return its value as a C level "complex double". */

Why is this?

OK, I think that's all that we need to do in Guile.  If you can get back
to me with some explanations on these patches and a transcript of your
debugging session, that would be great.  Also, if you are able to build
from git, you will find some of your changes incorporated there.

Thanks!

Andy
-- 
http://wingolog.org/





  reply	other threads:[~2011-12-22 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 15:53 bug#10235: guile 3.0.2 segfaults on FreeBSD 9 Jim Pryor
2011-12-22 15:35 ` Andy Wingo [this message]
     [not found]   ` <1324569357.9323.140661014858397@webmail.messagingengine.com>
2011-12-22 21:41     ` bug#10235: guile 2.0.3 " Andy Wingo
2013-03-10 21:14       ` Andy Wingo

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=87r4zwpqka.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=10235@debbugs.gnu.org \
    --cc=c11h15no2@yahoo.com \
    --cc=dubiousjim@gmail.com \
    /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).