From owner-freebsd-threads@FreeBSD.ORG Mon Aug 7 14:19:29 2006 Return-Path: X-Original-To: threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C39F716A503 for ; Mon, 7 Aug 2006 14:19:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60E6F43D45 for ; Mon, 7 Aug 2006 14:19:29 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id F034E46D0E for ; Mon, 7 Aug 2006 10:19:28 -0400 (EDT) Date: Mon, 7 Aug 2006 15:19:28 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: threads@FreeBSD.org Message-ID: <20060807151829.T45647@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: GHC 6.4.3 on FreeBSD (fwd) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 14:19:29 -0000 I've been talking to the Haskell folk about problems they've had getting their threaded runtime running on FreeBSD. Here's one of their problem reports. Since I'm not up on how threads and signals are supposed to act, I can't confirm the below is a bug, of course, but figured you (experts) would be able to respond better. Robert N M Watson Computer Laboratory University of Cambridge ---------- Forwarded message ---------- Date: Mon, 7 Aug 2006 15:12:19 +0100 From: Simon Marlow To: Volker Stolz , Robert Watson , Kip Macy Cc: Simon Peyton-Jones , Tony Finch , haskell@freebsd.org, glasgow-haskell-users@haskell.org Subject: GHC 6.4.3 on FreeBSD An update on the GHC/FreeBSD front: I didn't manage to reproduce the reported threading bugs on a UP, will be trying on a MP shortly. However, I did discover one odd case that libpthread doesn't appear to handle properly, but libthr does. This arose from a test in GHC's test suite, but I've transliterated the code from Haskell to C: $ cat thr1.c #include #include #include int main(int argc, char *argv[]) { sigset_t s; sigemptyset (&s); sigaddset(&s, SIGUSR1); sigprocmask(SIG_BLOCK, &s, NULL); pthread_kill(pthread_self(), SIGUSR1); sigpending(&s); printf("%x\n", s); exit(0); } $ gcc -pthread thr1.c $ ./a.out 0 $ gcc -lthr thr1.c $ ./a.out 20000000 $ This might (or might not) be related to the other threading issues with GHC on FreeBSD. Do you think we should link with -lthr by default on FreeBSD? This would be a trivial change to make, and given that GHC has its own lightweight threading runtime, we probably aren't getting much from having the KSE-based threading implementation anyway. Cheers, Simon