From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 15:40:36 2015 Received: (at submit) by debbugs.gnu.org; 29 Sep 2015 19:40:36 +0000 Received: from localhost ([127.0.0.1]:48218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zh0lP-00007r-BM for submit@debbugs.gnu.org; Tue, 29 Sep 2015 15:40:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58917) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zgzws-0007Jm-45 for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:48:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgzwq-0006Ro-Jn for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:48:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgzwq-0006Rk-HF for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:48:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgzwl-0004aq-Ih for bug-guile@gnu.org; Tue, 29 Sep 2015 14:48:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgzwh-0006Op-Ar for bug-guile@gnu.org; Tue, 29 Sep 2015 14:48:15 -0400 Received: from wilhelm.re ([2a00:d880:5:2c4::42]:55083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgzwh-0006OR-1l for bug-guile@gnu.org; Tue, 29 Sep 2015 14:48:11 -0400 Received: from wilhelm.re (localhost.localdomain [127.0.0.1]) by wilhelm.re (OpenSMTPD) with ESMTP id 7e0e160e for ; Tue, 29 Sep 2015 18:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wilhelm.re; h=mime-version :content-type:date:from:to:subject:message-id; s=dkim1; bh=J99/0 UBtayUHu3OJn2XPehZiQW0=; b=CvrVXTwioAsPEyUWC3O6hEMuxlIBOyifeClpo QtvosIxB5Gx91aCFJuO4G6TMfbbBeTynU0+vGBl9w5FDn2yf8GLYPy3ILH9Iv4DG +SQ5HyXyh4RM5UoHFYoaJa7Mqik9RgwJsJbAqb2q9Jilcs6MYuVAdZVaZBRs7Tb2 b4boT2/VKFO5cfobcA6GceF6xuA+kDg4AS7e8ROMdyYb12W0bt/FZWOU944/huDW QIUSbv9sp3A4iezmhT+NQK5KVpxa/5a0kL1Twm9quXOPBOyvryzcyZvfqWeBxR/9 dO1Q5nXjHNib4Gf8QYj3WUJM9av9m1Vk2hSphE8jfoyiQ5DUg== Received: by wilhelm.re (OpenSMTPD) with ESMTPSA id b28ea3b7 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-SHA bits=128 verify=NO for ; Tue, 29 Sep 2015 18:21:29 +0000 (UTC) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_6cfeeeaa066e86137a38259b0467ea69" Date: Tue, 29 Sep 2015 20:21:29 +0200 From: Wilhelm Schuster To: bug-guile@gnu.org Subject: Mac: Segfault when unloading shared object linked to libguile Message-ID: <986070ee429f12db07fc88613be335a5@wilhelm.re> X-Sender: wilhelm@wilhelm.re User-Agent: Roundcube Webmail/1.1.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 29 Sep 2015 15:40:33 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=_6cfeeeaa066e86137a38259b0467ea69 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi, I have a rather weird issue with guile on OSX Yosemite (10.10.5). The problem originally stems from weechat [1] which provides guile scripting through a dynamically loaded "plugin" (shared object). However, I was able to extract the problem into a smaller test program. 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. Here is my test case: $ cat test.c #include #include typedef int (*guile_func)(void); int main (void) { void *guile = NULL; guile_func init_func = NULL; printf("Loading Guile... "); guile = dlopen("guile.so", RTLD_GLOBAL | RTLD_NOW); if (!guile) printf("Error!\n"); else printf("Done!\n"); printf("Trying to load \"init_guile\" "); init_func = dlsym(guile, "init_guile"); if (!init_func) printf("Error!\n"); else { printf("Done!\n"); printf("Trying to run \"init_guile\"\n"); init_func(); } printf("Unloading Guile... "); fflush(stdout); dlclose(guile); printf("Done!\n"); } $ cat guile.c #include extern void init_guile(void); void init_guile(void) { scm_init_guile(); } When I compile and run the program I get the following output: $ clang -g -shared -o guile.so guile.c $(pkg-config --cflags --libs guile-2.0) $ clang -g test.c -o test $ ./test Loading Guile... Done! Trying to load "init_guile" Done! Trying to run "init_guile" Unloading Guile... [1] 41550 segmentation fault ./test The expected output: Loading Guile... Done! Trying to load "init_guile" Done! Trying to run "init_guile" Unloading Guile... Done! Here's an excerpt from the output when enabling dyld (dynamic linker) debugging information: $ DYLD_PRINT_APIS=1 ./test [...] dlopen(guile.so) ==> 0x7fbcc8e00000 Loading Guile... Done! dlsym(0x7fbcc8e00000, init_guile) Trying to load "init_guile" Done! Trying to run "init_guile" [...] Unloading Guile... dlclose(0x7fbcc8e00000) dlclose(), found unused image 0x7fbcc8e00000 guile.so dlclose(), found unused image 0x7fbcc8c00170 libguile-2.0.22.dylib dlclose(), found unused image 0x7fbcc8d04930 libgc.1.dylib dlclose(), found unused image 0x7fbcc8e00140 libffi.6.dylib dlclose(), found unused image 0x7fbcc8f00000 libunistring.2.dylib dlclose(), found unused image 0x7fbcc8f00130 libgmp.10.dylib dlclose(), found unused image 0x7fbcc8e001d0 libltdl.7.dylib dlclose(), deleting 0x7fbcc8e00000 guile.so dlclose(), deleting 0x7fbcc8c00170 libguile-2.0.22.dylib dlclose(), deleting 0x7fbcc8d04930 libgc.1.dylib dlclose(), deleting 0x7fbcc8e00140 libffi.6.dylib [1] 41585 segmentation fault DYLD_PRINT_APIS=1 ./test I have attached a lldb debugging session with backtrace. Cheers, Wilhelm Schuster. --=_6cfeeeaa066e86137a38259b0467ea69 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=lldb.log Content-Disposition: attachment; filename=lldb.log; size=1062 JCBsbGRiIC4vdGVzdAoobGxkYikgdGFyZ2V0IGNyZWF0ZSAiLi90ZXN0IgpDdXJyZW50IGV4ZWN1 dGFibGUgc2V0IHRvICcuL3Rlc3QnICh4ODZfNjQpLgoobGxkYikgcnVuClByb2Nlc3MgNDE2MDcg bGF1bmNoZWQ6ICcuL3Rlc3QnICh4ODZfNjQpCkxvYWRpbmcgR3VpbGUuLi4gRG9uZSEKVHJ5aW5n IHRvIGxvYWQgImluaXRfZ3VpbGUiIERvbmUhClRyeWluZyB0byBydW4gImluaXRfZ3VpbGUiClVu bG9hZGluZyBHdWlsZS4uLiBQcm9jZXNzIDQxNjA3IHN0b3BwZWQKKiB0aHJlYWQgIzE6IHRpZCA9 IDB4MjNlNDBkLCAweDAwMDAwMDAxMDAwM2ViNzAsIHF1ZXVlID0gJ2NvbS5hcHBsZS5tYWluLXRo cmVhZCcsIHN0b3AgcmVhc29uID0gRVhDX0JBRF9BQ0NFU1MgKGNvZGU9MSwgYWRkcmVzcz0weDEw MDAzZWI3MCkKICAgIGZyYW1lICMwOiAweDAwMDAwMDAxMDAwM2ViNzAKZXJyb3I6IG1lbW9yeSBy ZWFkIGZhaWxlZCBmb3IgMHgxMDAwM2VhMDAKKGxsZGIpIHRocmVhZCBiYWNrdHJhY2UgMQoqIHRo cmVhZCAjMTogdGlkID0gMHgyM2U0MGQsIDB4MDAwMDAwMDEwMDAzZWI3MCwgcXVldWUgPSAnY29t LmFwcGxlLm1haW4tdGhyZWFkJywgc3RvcCByZWFzb24gPSBFWENfQkFEX0FDQ0VTUyAoY29kZT0x LCBhZGRyZXNzPTB4MTAwMDNlYjcwKQogICogZnJhbWUgIzA6IDB4MDAwMDAwMDEwMDAzZWI3MAog ICAgZnJhbWUgIzE6IDB4MDAwMDdmZmY1ZmMwMWNkMyBkeWxkYGR5bGQ6OnJlbW92ZUltYWdlKElt YWdlTG9hZGVyKikgKyAzMzgKICAgIGZyYW1lICMyOiAweDAwMDA3ZmZmNWZjMDRmYmMgZHlsZGBk eWxkOjpnYXJiYWdlQ29sbGVjdEltYWdlcygpICsgODIzCiAgICBmcmFtZSAjMzogMHgwMDAwN2Zm ZjVmYzBjM2U4IGR5bGRgZGxjbG9zZSArIDEzNAogICAgZnJhbWUgIzQ6IDB4MDAwMDdmZmY4ZjE5 NTgwOCBsaWJkeWxkLmR5bGliYGRsY2xvc2UgKyA2MQogICAgZnJhbWUgIzU6IDB4MDAwMDAwMDEw MDAwMGU5NyB0ZXN0YG1haW4gKyAyNzkgYXQgdGVzdC5jOjQ4CiAgICBmcmFtZSAjNjogMHgwMDAw N2ZmZjhmMTk2NWM5IGxpYmR5bGQuZHlsaWJgc3RhcnQgKyAx --=_6cfeeeaa066e86137a38259b0467ea69-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 16:48:15 2015 Received: (at submit) by debbugs.gnu.org; 29 Sep 2015 20:48:15 +0000 Received: from localhost ([127.0.0.1]:48236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zh1ot-0001il-1L for submit@debbugs.gnu.org; Tue, 29 Sep 2015 16:48:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59360) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zh00K-0007Os-9M for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zh00J-0007hk-C1 for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:51:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zh00J-0007he-8y for submit@debbugs.gnu.org; Tue, 29 Sep 2015 14:51:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zh00I-0005Fs-Dp for bug-guile@gnu.org; Tue, 29 Sep 2015 14:51:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zh00H-0007hA-CF for bug-guile@gnu.org; Tue, 29 Sep 2015 14:51:54 -0400 Received: from wilhelm.re ([2a00:d880:5:2c4::42]:55084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zh00H-0007gu-4J for bug-guile@gnu.org; Tue, 29 Sep 2015 14:51:53 -0400 Received: from wilhelm.re (localhost.localdomain [127.0.0.1]) by wilhelm.re (OpenSMTPD) with ESMTP id f522265a for ; Tue, 29 Sep 2015 18:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wilhelm.re; h=mime-version :content-type:content-transfer-encoding:date:from:to:subject :in-reply-to:references:message-id; s=dkim1; bh=TasRQSGTfNtM+UCQ Jp7Tqc7n8js=; b=KQwdjXGvxq87BVrqy6tltG3ITYRtW4xQ5SZZdA7L47t2O38k U6dPWTrsS2DenFPmnMWompHUYvkp/fql35F2U2USCS7jTlYQEzucWhSo4e3hTPiR jKMw6fiK7tdpNclDticF1cLLWqqeLhG6MNEJkY9hC/Xd9meqRp2CNVRp1jyt3Exw +7AbH+riyIYv7see/QwjTGZ8aVoE+pxxfzJNJbvFnAGancKcRSifS+I837pqAGeq Ng4Vd8VLwO+HYLQVF8LXiqgJtWlXj6viziSJQ5719eRtwxwhrJO6O/FbIbXgbx6I s1+3gyOBgDqQFkEa6dpkpyeqvVC/GTw0iBWxmw== Received: by wilhelm.re (OpenSMTPD) with ESMTPSA id 2314398a TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-SHA bits=128 verify=NO for ; Tue, 29 Sep 2015 18:25:12 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 29 Sep 2015 20:25:12 +0200 From: Wilhelm Schuster To: bug-guile@gnu.org Subject: Re: Mac: Segfault when unloading shared object linked to libguile In-Reply-To: <986070ee429f12db07fc88613be335a5@wilhelm.re> References: <986070ee429f12db07fc88613be335a5@wilhelm.re> Message-ID: <2d50f1a7ef01e204dd73da37c7f732c1@wilhelm.re> X-Sender: wilhelm@wilhelm.re User-Agent: Roundcube Webmail/1.1.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 29 Sep 2015 16:48:13 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I forgot to include the link to the original issue: [1]: https://github.com/weechat/weechat/issues/527 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 08:33:01 2016 Received: (at 21587) by debbugs.gnu.org; 24 Jun 2016 12:33:01 +0000 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 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 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= 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) 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) From: Andy Wingo To: Wilhelm Schuster Subject: Re: bug#21587: Mac: Segfault when unloading shared object linked to libguile References: <986070ee429f12db07fc88613be335a5@wilhelm.re> Date: Fri, 24 Jun 2016 14:32:48 +0200 In-Reply-To: <986070ee429f12db07fc88613be335a5@wilhelm.re> (Wilhelm Schuster's message of "Tue, 29 Sep 2015 20:21:29 +0200") Message-ID: <87h9cig427.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: C717E102-3A07-11E6-B49D-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 21587 Cc: 21587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 28 09:29:45 2017 Received: (at 21587-done) by debbugs.gnu.org; 28 Feb 2017 14:29:45 +0000 Received: from localhost ([127.0.0.1]:59255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciimf-0008GR-8g for submit@debbugs.gnu.org; Tue, 28 Feb 2017 09:29:45 -0500 Received: from pb-sasl2.pobox.com ([64.147.108.67]:59065 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciimd-0008GI-4J for 21587-done@debbugs.gnu.org; Tue, 28 Feb 2017 09:29:43 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id D31C15F2FA; Tue, 28 Feb 2017 09:29:39 -0500 (EST) 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=ijE+ZBhNvBZkKip4eElRhodsW0Q=; b=eT9wRo I1Dd4gCRdc+7K3PaoxYLJMnNTzAL/F9mLRTi6obXqPJ/we3hH14hZe2WbdgzIrnm iJzn9qCHou9H7R/4i0Mg0LPgi6CZZwyURrfE9fOQLRM5TRsUqcseP21sIgnpmyv2 5xuqjR2fYHj3AZ87sPnYcJrisRHW9ti6/hbII= 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=yXTXGFH7Gtx40l2v02gGInFUTF6bHInZ RFT6HZEjM4yR91y7SW+gEOy+3FjgD2ICCGImGWpHFmfwdT2fFDzwHmNnb2k9o7IC 3PVjRn5bLJUqB3+39X/9sPoSof/YjbBUCTmJu/ZACFOMDWAjFaXeFA+Kc5mATdyK EbRu9H2HuRg= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id C4BF65F2F9; Tue, 28 Feb 2017 09:29:39 -0500 (EST) 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-sasl2.pobox.com (Postfix) with ESMTPSA id E70625F2F8; Tue, 28 Feb 2017 09:29:38 -0500 (EST) From: Andy Wingo To: Wilhelm Schuster Subject: Re: bug#21587: Mac: Segfault when unloading shared object linked to libguile References: <986070ee429f12db07fc88613be335a5@wilhelm.re> <87h9cig427.fsf@pobox.com> Date: Tue, 28 Feb 2017 15:29:31 +0100 In-Reply-To: <87h9cig427.fsf@pobox.com> (Andy Wingo's message of "Fri, 24 Jun 2016 14:32:48 +0200") Message-ID: <87innumlro.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 560F9A3E-FDC2-11E6-9BF8-6141F2301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21587-done Cc: 21587-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Closing as not-a-bug given discussion below. Please reply if you have additional comments/etc. Thanks. Andy On Fri 24 Jun 2016 14:32, Andy Wingo writes: > 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 From unknown Sun Jun 22 13:39:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 29 Mar 2017 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator