[Top][All Lists]

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

[Chicken-users] Strange segfaults when linking with pthreads

From: Peter Bex
Subject: [Chicken-users] Strange segfaults when linking with pthreads
Date: Thu, 3 Mar 2011 21:01:04 +0100
User-agent: Mutt/

Hello there,

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
(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 ...
; loading /usr/pkg/lib/chicken/5/ ...
; loading /usr/pkg/lib/chicken/5/ ...
; loading /usr/pkg/lib/chicken/5/ ...
; loading /usr/pkg/lib/chicken/5/ ...
; loading /usr/pkg/lib/chicken/5/ ...
; loading /usr/pkg/lib/chicken/5/ ...
#;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 :)

You might wonder why I'm trying to link against libpthread, but that's
not really what I'm trying to do.  For example, svn-client links against
libsvn_client, which itself links to libpthread (through apr, I think).

If this segfault happens, I simply can't work on svn-client.

I am currently very uncertain whether this is a bug in Chicken,
libpthread on NetBSD, the combination of the two, or something else.

HELP! ;)

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

reply via email to

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