[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Strange segfaults when linking with pthreads
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-users] Strange segfaults when linking with pthreads |
Date: |
Thu, 03 Mar 2011 15:10:53 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) |
Hi Peter,
On Thu, 3 Mar 2011 21:01:04 +0100 Peter Bex <address@hidden> wrote:
> I've been observing something really strange for a while and decided to
> finally dig a little deeper. It appears that when I link to libpthread,
> even if I don't use it, Chicken segfaults.
>
> To reproduce this, put the following in a file called "foo.scm":
> (module foo *
> (import chicken scheme)
> ;; Just a lot of semi-random libraries here:
> (use srfi-1 srfi-13 srfi-4 data-structures spiffy test)
> (print "yo"))
>
> Then when I run
> $ csc -s -lpthread foo.scm
> $ csi
> CHICKEN
> (c)2008-2010 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.6.0
> netbsd-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
> compiled 2011-01-21 on langly (NetBSD)
>
> #;1> (load "foo")
> ; loading foo.so ...
> ; loading /usr/pkg/lib/chicken/5/chicken.import.so ...
> ; loading /usr/pkg/lib/chicken/5/scheme.import.so ...
> ; loading /usr/pkg/lib/chicken/5/srfi-1.import.so ...
> ; loading /usr/pkg/lib/chicken/5/srfi-13.import.so ...
> ; loading /usr/pkg/lib/chicken/5/srfi-4.import.so ...
> [ETCETERA]
> ; loading /usr/pkg/lib/chicken/5/test.so ...
> yo
> #;2> zsh: segmentation fault csi
>
>
> This appears to happen *only* on 64-bit platforms, I don't see it on
> my 32-bit powerpc mac. The segfault is a bit elusive because it happens
> only after I load lots of libraries. When csi is invoked with -e or
> with -q, I generally don't get the segfault as easily, so it probably
> has something to do with the garbage collector; when it generates many
> strings it needs to clean up it fails. Or something :)
I cannot reproduce the problem on Linux:
$ csc -s -lpthread foo.scm
$ csi -n
CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.2
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2010-10-11 on monster (Linux)
#;1> (load "foo")
; loading foo.so ...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/chicken.import.so ...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/scheme.import.so
...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/sendfile.so ...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/intarweb.so ...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/base64.so ...
; loading /home/mario/local/chicken-4.6.2/lib/chicken/5/test.so ...
yo
Best wishes.
Mario
--
http://parenteses.org/mario