From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sheheryar Parvaz Newsgroups: gmane.lisp.guile.bugs Subject: bug#30261: segfault on simultaneous initialization Date: Sat, 27 Jan 2018 00:58:06 +0000 Message-ID: References: , <87mv10kx2i.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_" X-Trace: blaine.gmane.org 1517015786 30016 195.159.176.226 (27 Jan 2018 01:16:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Jan 2018 01:16:26 +0000 (UTC) Cc: "30261@debbugs.gnu.org" <30261@debbugs.gnu.org> To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jan 27 02:16:22 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efF6I-0006t2-0I for guile-bugs@m.gmane.org; Sat, 27 Jan 2018 02:16:10 +0100 Original-Received: from localhost ([::1]:40933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efF8I-0002If-Gi for guile-bugs@m.gmane.org; Fri, 26 Jan 2018 20:18:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efF8A-0002Ha-SQ for bug-guile@gnu.org; Fri, 26 Jan 2018 20:18:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efF86-0003Z3-Sq for bug-guile@gnu.org; Fri, 26 Jan 2018 20:18:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efF86-0003Yx-PF for bug-guile@gnu.org; Fri, 26 Jan 2018 20:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1efF86-0002Fb-BI for bug-guile@gnu.org; Fri, 26 Jan 2018 20:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sheheryar Parvaz Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 27 Jan 2018 01:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30261 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 30261-submit@debbugs.gnu.org id=B30261.15170158318595 (code B ref 30261); Sat, 27 Jan 2018 01:18:02 +0000 Original-Received: (at 30261) by debbugs.gnu.org; 27 Jan 2018 01:17:11 +0000 Original-Received: from localhost ([127.0.0.1]:44161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efF7G-0002EY-DO for submit@debbugs.gnu.org; Fri, 26 Jan 2018 20:17:10 -0500 Original-Received: from mail-oln040092008012.outbound.protection.outlook.com ([40.92.8.12]:4494 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efEov-0001nZ-DS for 30261@debbugs.gnu.org; Fri, 26 Jan 2018 19:58:14 -0500 Original-Received: from BY2NAM03FT043.eop-NAM03.prod.protection.outlook.com (10.152.84.60) by BY2NAM03HT036.eop-NAM03.prod.protection.outlook.com (10.152.85.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.444.13; Sat, 27 Jan 2018 00:58:06 +0000 Original-Received: from CY4PR13MB1591.namprd13.prod.outlook.com (10.152.84.57) by BY2NAM03FT043.mail.protection.outlook.com (10.152.85.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.444.13 via Frontend Transport; Sat, 27 Jan 2018 00:58:06 +0000 Original-Received: from CY4PR13MB1591.namprd13.prod.outlook.com ([fe80::6d55:62be:b054:50b8]) by CY4PR13MB1591.namprd13.prod.outlook.com ([fe80::6d55:62be:b054:50b8%2]) with mapi id 15.20.0464.008; Sat, 27 Jan 2018 00:58:06 +0000 Thread-Topic: bug#30261: segfault on simultaneous initialization Thread-Index: AQHTlsp6xNAj/YVgVky0AtdTwEr5/qOG0Wt4gAASxwg= In-Reply-To: <87mv10kx2i.fsf@netris.org> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:03BDACE0225208BC287EE04CDCB05DD2450745860F124EACD9CCC721080B15AF; UpperCasedChecksum:5EE56E086538453E239A95A367B9DC72512164F0E6EEA06841BB7E93CECA5B2E; SizeAsReceived:7113; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [huNbLh1x0EFgZeDB5jOL+f7TXLay2u49] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY2NAM03HT036; 6:oFEwk6LgOTE43cFSZQQN/5IXPQtIWPXyMkvSdsNWNI2FiayTgWo1FdT7g5dldVJeEuZp08DJt+KDaFg6cC3lG/TbyMxrsH10FRIOQCIgb8HoPmY1uQBcJTqW86EIKw6AwrSbfh21jP77TOssxl90BuUuGcRWbHDcdnVl3++OXeVNeyv1ksiX9Cvwf5vTNiIgodypbkadTaigHq0SI5yq8gZ9ltOBmO8WSn8XBNF9jTV4IXMM3YfrmX3UJMeyGGamd2pLtvC99WqhdW66qVFqGgOJElSpuD2mmpHk0KzWT7fIB4zCUt3PlkIXi03mG1jNDxoAqeKTl8N5ggpuHJP2kyORrYJgxXybEIjZ4q5aXmU=; 5:4kQctgat9ldCDWdQlCoeqRZyaaEXMvBKyVEgUhkG+XA0cmKDNKaRHgntmuDE5SdAX+mvC8xU8XrZ4Xk3YvXk/fP0ldqL3goK4/hJyevF71b6Eqn1ZMOpmNYzj1R3lAH6OoFw+KzW1dqUik+G8twG1KZlc5xc0yTWgBa4IT1ykAQ=; 24:LxWOEhHZyDcpkV/RSN0uEVybRNbqIGiRo5p6HjhYi9ujsv8TUa2rYwyu0SZNUqLMOZJsUsKLhCYuw6c2QuHZEfLf/71hnvSrysk5Td1K3S0=; 7:a7wi5ntpTHIW9BhvotWwSL9KY+NBRzEyBzWjZfUxJj1HKi3sTYOjHc0F4+7PCeO6fLTd/yjLx6MLhrOVPNuQvSKUdclPFG6aHR6La2WAlTOkKRYMtSh9Hr2txh8LFpPDk12hdOYuOKT/UdlDOOkDsOT2EFUuCFFq0aTBi7tTSZDtQ+m99coHAK8fn x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045); SRVR:BY2NAM03HT036; x-ms-traffictypediagnostic: BY2NAM03HT036: x-ms-office365-filtering-correlation-id: b3e0df8a-50e3-4ebc-717e-08d5652106ef x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BY2NAM03HT036; BCL:0; PCL:0; RULEID:; SRVR:BY2NAM03HT036; x-forefront-prvs: 056544FBEE x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:BY2NAM03HT036; H:CY4PR13MB1591.namprd13.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3e0df8a-50e3-4ebc-717e-08d5652106ef X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jan 2018 00:58:06.6544 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM03HT036 X-Mailman-Approved-At: Fri, 26 Jan 2018 20:17:08 -0500 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:8985 Archived-At: --_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Are there any decent workarounds for this? I considered scm_init_guile, how= ever according to the documentation, it is non-portable. For modules, I have no = idea how I would initialize them. ________________________________ From: Mark H Weaver Sent: January 26, 2018 6:41 PM To: Sheheryar Parvaz Cc: 30261@debbugs.gnu.org Subject: Re: bug#30261: segfault on simultaneous initialization Hi, Sheheryar Parvaz writes: > If the initial call to scm_with_guile is on a thread and in the main > thread at the same time, a segmentation fault occurs. Yes, this is a known issue. At present, Guile must be fully initialized in one thread before it can be safely used from any other thread. Furthermore, when loading modules, you must ensure that no other thread attempts to load or use the same module while it's being loaded. If possible, please arrange to load all modules that your program will need before accessing Guile from other threads. We'd like to fix this at some point, but for various reasons it's a non-trivial project. Thanks, Mark --_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Are there any decent workarounds for this? I considered scm_init_guile, how= ever
according to the documentation, it is non-portable. For modules, I have no = idea how
I would initialize them.

From: Mark H Weaver <mhw= @netris.org>
Sent: January 26, 2018 6:41 PM
To: Sheheryar Parvaz
Cc: 30261@debbugs.gnu.org
Subject: Re: bug#30261: segfault on simultaneous initialization
 
Hi,

Sheheryar Parvaz <skipper308@hotmail.ca> writes:
> If the initial call to scm_with_guile is on a thread and in the main > thread at the same time, a segmentation fault occurs.

Yes, this is a known issue.  At present, Guile must be fully initializ= ed
in one thread before it can be safely used from any other thread.
Furthermore, when loading modules, you must ensure that no other thread
attempts to load or use the same module while it's being loaded.  If possible, please arrange to load all modules that your program will need before accessing Guile from other threads.

We'd like to fix this at some point, but for various reasons it's a
non-trivial project.

     Thanks,
       Mark
--_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_--