From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#21587: Mac: Segfault when unloading shared object linked to libguile Date: Fri, 24 Jun 2016 14:32:48 +0200 Message-ID: <87h9cig427.fsf@pobox.com> References: <986070ee429f12db07fc88613be335a5@wilhelm.re> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466771726 22838 80.91.229.3 (24 Jun 2016 12:35:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 12:35:26 +0000 (UTC) Cc: 21587@debbugs.gnu.org To: Wilhelm Schuster Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jun 24 14:35:16 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGQKK-0007am-01 for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 14:35:16 +0200 Original-Received: from localhost ([::1]:43164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQKJ-0001tz-7z for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 08:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQJB-0001FB-VA for bug-guile@gnu.org; Fri, 24 Jun 2016 08:34:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGQJ8-0002Oc-QA for bug-guile@gnu.org; Fri, 24 Jun 2016 08:34:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQJ8-0002OU-Ju for bug-guile@gnu.org; Fri, 24 Jun 2016 08:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGQJ8-0001Qz-GP for bug-guile@gnu.org; Fri, 24 Jun 2016 08:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 24 Jun 2016 12:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21587 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 21587-submit@debbugs.gnu.org id=B21587.14667715815433 (code B ref 21587); Fri, 24 Jun 2016 12:34:02 +0000 Original-Received: (at 21587) by debbugs.gnu.org; 24 Jun 2016 12:33:01 +0000 Original-Received: from localhost ([127.0.0.1]:53498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGQI9-0001PT-0p for submit@debbugs.gnu.org; Fri, 24 Jun 2016 08:33:01 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:52199 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGQI7-0001PK-1C for 21587@debbugs.gnu.org; Fri, 24 Jun 2016 08:32:59 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id AE6502035F; Fri, 24 Jun 2016 08:32:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ChJRY1JqSvBw+jq64viO7GV0xjg=; b=eWmnYP H5WGiwo9u5Dkt2QZ91iZVCUCP6f2Aejsg85ddJlkt/T5bjCSY1/GSaJ39KxYy58u D9QBk8EVDPkiL0Ff5ecuVyjvzpJaLhMKl1sK+6S8xufj8fR32V6Ukl+h14uU+PLI ku9Y60UYQmnkJOcTCa/spmoC9GE4BX1mb555M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=VdHRdfoZA4yaxLoerXEWt0XKcI0UrW8U IOJTubI6qk6XjzlWiHRB411j3WLJ5zZaUlQ8RN98T9E8C4yr7jfpCAOGXIsA0DYL KXvUSbAv/7fuo6cXJ01iGf3XCOqx41q5R0zBuFDmdCNP2MxMp3JJclvPPMUQ6+Za Vt+SfuMvQWA= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id A68562035E; Fri, 24 Jun 2016 08:32:56 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id C18512035D; Fri, 24 Jun 2016 08:32:55 -0400 (EDT) In-Reply-To: <986070ee429f12db07fc88613be335a5@wilhelm.re> (Wilhelm Schuster's message of "Tue, 29 Sep 2015 20:21:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: C717E102-3A07-11E6-B49D-C1836462E9F6-02397024!pb-sasl1.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8221 Archived-At: On Tue 29 Sep 2015 20:21, Wilhelm Schuster writes: > The basic run down: When I try to unload (using dlclose() ) a shared > object that is linked to libguile after calling scm_init_guile() OR > scm_with_guile(), a Segfault is triggered. Hummmmmmmmmmmm! Well, so this is quite tricky. Loading Guile loads Guile which might start threads (some helper threads behind the scenes for finalization (see section on scm_set_automatic_finalization_enabled in tha manual), perhaps a thread to listen for signals, and then the garbage collector that we use (libgc) might start parallel marking threads (though you can control that parameter too). Guile doesn't really provide an interface to allow it to shut down cleanly and I don't know if it can. (I guess it could.) However it would take quite some amount of work and I don't see us doing it any time soon. In any case simply trying to dlclose() is never likely to work, as you aren't synchronizing with Guile itself. Sorry for the bad news! Andy