GNU bug report logs - #30261
segfault on simultaneous initialization

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Sheheryar Parvaz <skipper308@HIDDEN>; dated Fri, 26 Jan 2018 17:38:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 30261 <at> debbugs.gnu.org:


Received: (at 30261) by debbugs.gnu.org; 27 Jan 2018 20:28:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 15:28:02 2018
Received: from localhost ([127.0.0.1]:45518 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efX4z-0007aH-S3
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 15:28:02 -0500
Received: from world.peace.net ([50.252.239.5]:49942)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@HIDDEN>) id 1efX4y-0007a3-AL
 for 30261 <at> debbugs.gnu.org; Sat, 27 Jan 2018 15:28:00 -0500
Received: from pool-72-93-27-251.bstnma.east.verizon.net ([72.93.27.251]
 helo=jojen)
 by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <mhw@HIDDEN>)
 id 1efX4s-0000kl-1c; Sat, 27 Jan 2018 15:27:54 -0500
From: Mark H Weaver <mhw@HIDDEN>
To: Sheheryar Parvaz <skipper308@HIDDEN>
Subject: Re: bug#30261: segfault on simultaneous initialization
References: <DM5PR13MB159629F5A5A3B229022C7AD4F1E00@HIDDEN>
 <87mv10kx2i.fsf@HIDDEN>
 <CY4PR13MB15919CE881BCB5EB10C044E8F1E70@HIDDEN>
Date: Sat, 27 Jan 2018 15:27:21 -0500
In-Reply-To: <CY4PR13MB15919CE881BCB5EB10C044E8F1E70@HIDDEN>
 (Sheheryar Parvaz's message of "Sat, 27 Jan 2018 00:58:06 +0000")
Message-ID: <87vafnoxna.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30261
Cc: "30261 <at> debbugs.gnu.org" <30261 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Sheheryar Parvaz <skipper308@HIDDEN> wrote:
> 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.

Mark H Weaver <mhw@HIDDEN> wrote:
> 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.

Sheheryar Parvaz <skipper308@HIDDEN> writes:
> Are there any decent workarounds for this? I considered
> scm_init_guile, however according to the documentation, it is
> non-portable. For modules, I have no idea how I would initialize them.

The usual approach is to initialize Guile before spawning any other
threads.  You can do this by calling 'scm_with_guile' early in your
'main', and then moving most of the contents of your 'main' into the
inner function that 'scm_with_guile' calls.

If there are modules that you'll need to load from your threaded code,
then load them before spawning any threads, from within the inner
function that 'scm_with_guile' calls.  From C, you can load modules with
'scm_c_resolve_module'.

      Mark




Information forwarded to bug-guile@HIDDEN:
bug#30261; Package guile. Full text available.

Message received at 30261 <at> debbugs.gnu.org:


Received: (at 30261) by debbugs.gnu.org; 27 Jan 2018 01:17:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 20:17:11 2018
Received: from localhost ([127.0.0.1]:44161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efF7G-0002EY-DO
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 20:17:10 -0500
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 <skipper308@HIDDEN>) id 1efEov-0001nZ-DS
 for 30261 <at> debbugs.gnu.org; Fri, 26 Jan 2018 19:58:14 -0500
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
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
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
From: Sheheryar Parvaz <skipper308@HIDDEN>
To: Mark H Weaver <mhw@HIDDEN>
Subject: Re: bug#30261: segfault on simultaneous initialization
Thread-Topic: bug#30261: segfault on simultaneous initialization
Thread-Index: AQHTlsp6xNAj/YVgVky0AtdTwEr5/qOG0Wt4gAASxwg=
Date: Sat, 27 Jan 2018 00:58:06 +0000
Message-ID: <CY4PR13MB15919CE881BCB5EB10C044E8F1E70@HIDDEN>
References: <DM5PR13MB159629F5A5A3B229022C7AD4F1E00@HIDDEN>,
 <87mv10kx2i.fsf@HIDDEN>
In-Reply-To: <87mv10kx2i.fsf@HIDDEN>
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+m99coHAK8fnbQQTchJ3G1uv6v0ORsxskKgU+bYDTiQ4FuVjxDQ8JQ7bnrXtSFD9gEgJwsr40b906kdzQYE
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
Content-Type: multipart/alternative;
 boundary="_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_"
MIME-Version: 1.0
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-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 30261
X-Mailman-Approved-At: Fri, 26 Jan 2018 20:17:08 -0500
Cc: "30261 <at> debbugs.gnu.org" <30261 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

--_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 <mhw@HIDDEN>
Sent: January 26, 2018 6:41 PM
To: Sheheryar Parvaz
Cc: 30261 <at> debbugs.gnu.org
Subject: Re: bug#30261: segfault on simultaneous initialization

Hi,

Sheheryar Parvaz <skipper308@HIDDEN> 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

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
Are there any decent workarounds for this? I considered scm_init_guile, how=
ever</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
according to the documentation, it is non-portable. For modules, I have no =
idea how</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
I would initialize them.<br>
</div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Mark H Weaver &lt;mhw=
@netris.org&gt;<br>
<b>Sent:</b> January 26, 2018 6:41 PM<br>
<b>To:</b> Sheheryar Parvaz<br>
<b>Cc:</b> 30261 <at> debbugs.gnu.org<br>
<b>Subject:</b> Re: bug#30261: segfault on simultaneous initialization</fon=
t>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">Hi,<br>
<br>
Sheheryar Parvaz &lt;skipper308@HIDDEN&gt; writes:<br>
&gt; If the initial call to scm_with_guile is on a thread and in the main<b=
r>
&gt; thread at the same time, a segmentation fault occurs.<br>
<br>
Yes, this is a known issue.&nbsp; At present, Guile must be fully initializ=
ed<br>
in one thread before it can be safely used from any other thread.<br>
Furthermore, when loading modules, you must ensure that no other thread<br>
attempts to load or use the same module while it's being loaded.&nbsp; If<b=
r>
possible, please arrange to load all modules that your program will need<br=
>
before accessing Guile from other threads.<br>
<br>
We'd like to fix this at some point, but for various reasons it's a<br>
non-trivial project.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Thanks,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mark<br>
</div>
</span></font></div>
</body>
</html>

--_000_CY4PR13MB15919CE881BCB5EB10C044E8F1E70CY4PR13MB1591namp_--




Information forwarded to bug-guile@HIDDEN:
bug#30261; Package guile. Full text available.

Message received at 30261 <at> debbugs.gnu.org:


Received: (at 30261) by debbugs.gnu.org; 26 Jan 2018 23:43:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 18:43:48 2018
Received: from localhost ([127.0.0.1]:44142 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efDeu-00009j-9v
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 18:43:48 -0500
Received: from world.peace.net ([50.252.239.5]:43300)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@HIDDEN>) id 1efDes-00009X-80
 for 30261 <at> debbugs.gnu.org; Fri, 26 Jan 2018 18:43:46 -0500
Received: from turntable.mit.edu ([18.18.160.11] helo=yeeloong)
 by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <mhw@HIDDEN>)
 id 1efDem-0004DU-5v; Fri, 26 Jan 2018 18:43:40 -0500
From: Mark H Weaver <mhw@HIDDEN>
To: Sheheryar Parvaz <skipper308@HIDDEN>
Subject: Re: bug#30261: segfault on simultaneous initialization
References: <DM5PR13MB159629F5A5A3B229022C7AD4F1E00@HIDDEN>
Date: Fri, 26 Jan 2018 18:41:09 -0500
In-Reply-To: <DM5PR13MB159629F5A5A3B229022C7AD4F1E00@HIDDEN>
 (Sheheryar Parvaz's message of "Fri, 26 Jan 2018 17:24:11 +0000")
Message-ID: <87mv10kx2i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30261
Cc: 30261 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Hi,

Sheheryar Parvaz <skipper308@HIDDEN> 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




Information forwarded to bug-guile@HIDDEN:
bug#30261; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Jan 2018 17:37:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 12:37:38 2018
Received: from localhost ([127.0.0.1]:43989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ef7wY-0006NS-3Y
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 12:37:38 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <skipper308@HIDDEN>) id 1ef7jk-0005nj-Rp
 for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 12:24:25 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <skipper308@HIDDEN>) id 1ef7je-0005DK-Kc
 for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 12:24:19 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: ***
X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_50,
 FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,
 RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:36629)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <skipper308@HIDDEN>)
 id 1ef7je-0005Cx-Gm
 for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 12:24:18 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55574)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <skipper308@HIDDEN>) id 1ef7jd-0002bU-9C
 for bug-guile@HIDDEN; Fri, 26 Jan 2018 12:24:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <skipper308@HIDDEN>) id 1ef7jZ-0005A2-69
 for bug-guile@HIDDEN; Fri, 26 Jan 2018 12:24:17 -0500
Received: from mail-oln040092003080.outbound.protection.outlook.com
 ([40.92.3.80]:2055 helo=NAM02-BL2-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <skipper308@HIDDEN>)
 id 1ef7jY-00059M-Vl
 for bug-guile@HIDDEN; Fri, 26 Jan 2018 12:24:13 -0500
Received: from SN1NAM02FT034.eop-nam02.prod.protection.outlook.com
 (10.152.72.53) by SN1NAM02HT157.eop-nam02.prod.protection.outlook.com
 (10.152.73.87) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.444.13; Fri, 26
 Jan 2018 17:24:11 +0000
Received: from DM5PR13MB1596.namprd13.prod.outlook.com (10.152.72.54) by
 SN1NAM02FT034.mail.protection.outlook.com (10.152.72.141) 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; Fri, 26 Jan 2018 17:24:11 +0000
Received: from DM5PR13MB1596.namprd13.prod.outlook.com ([10.175.111.11]) by
 DM5PR13MB1596.namprd13.prod.outlook.com ([10.175.111.11]) with mapi id
 15.20.0444.016; Fri, 26 Jan 2018 17:24:11 +0000
From: Sheheryar Parvaz <skipper308@HIDDEN>
To: "bug-guile@HIDDEN" <bug-guile@HIDDEN>
Subject: segfault on simultaneous initialization
Thread-Topic: segfault on simultaneous initialization
Thread-Index: AQHTlsp6xNAj/YVgVky0AtdTwEr5/g==
Date: Fri, 26 Jan 2018 17:24:11 +0000
Message-ID: <DM5PR13MB159629F5A5A3B229022C7AD4F1E00@HIDDEN>
Accept-Language: en-CA, en-US
Content-Language: en-CA
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-incomingtopheadermarker: OriginalChecksum:03CA1E570D9A4B1E7284B31BF4935E09A13DC7951DD6371DBBC0D2C7FDA49C70;
 UpperCasedChecksum:D8F9666A2003D61C58542761DB702B0E36889426A564A24D5670654EDB0CC80B;
 SizeAsReceived:6808; Count:43
x-tmn: [jNL38sFPcUbSFu88YWFeKs+qTLmk/Idg]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; SN1NAM02HT157;
 6:by9TpS1fgTWKkFX4luUfNExBlZTHPRHLACs+jsQby1MuvrdUhpphliNpVRnJR24Msb7GTDvO2aEA/vaugp2Y7vvey+iX8oHKDH8QSHePUde6A9/+fLNdnvz5V+HlczSA8Pe2bgW9GIoRe5aAaJn0eLtpEhjHoVBinJmn/Z2lqccOkvxcUploSDMJhN6dRBVNs4rHPbKPJFwXqMXLUQtpZGsVcWnTYeqqcJfCUAYcCnEzRsQmuFDq8CS7ViixyE8A8Bt27Wi7bGR777XFCbz6FfTZsyXHnrbRJp13pUfsQVgqXkXVTdSPH2h4TMDCIovAJDlpyC8iyT23QCzToWr0eHVgGthcdHnBDn/bLM3mE5g=;
 5:im8cmjMBE+sEE8Ts0+OONTTRUn8YP9fswh2gCnhWFn4cuO3y6d0XwdmTpy1LXclYCP4RRi1P1xUDOWHHZJJfVxZ6c6heNCQUP7C12yX15PpgYPPzf5GD0gbX+oug4Eo8bSSXDwJLAyBvz4/EdpNBI6MtDZSuxiyad8ip/lG7rS4=;
 24:iuwU+WIm3F/DrbfCOpYxERdoap/9sSixIaOaxTJzW/+GA0b1mUjtJGS58+i1VGPWRTZbJBlpvtW6rgT/fEySB6wtahrRjAgYmIs/P7u9rkw=;
 7:WlZn7dX/QMYDzZNH5yVOhn99cJ6D/OwrQw7wnxNAcv5xBXNP8u9uElGuPpVyEKOPfCeZzg2nF7hIZhNFDgltfPsu0wkil/SYPQdEEzOCKkw4CxfqLWDcHI+8ksCQWHebfbfTN7h8TgLzjGbW+IZJ5457lmOT43uI6UkcbY8S1xgEpB+0LuWROMdzXBIlesyP+9k1yhHRe4i+pPdyDk/xkur4k9g6GJl98WAtVAEzbGlaHS67HBzkYdPHUxqCpvdP
x-incomingheadercount: 43
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:SN1NAM02HT157; 
x-ms-traffictypediagnostic: SN1NAM02HT157:
x-ms-office365-filtering-correlation-id: e0cbfed1-747c-4318-926e-08d564e19d94
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031);
 SRVR:SN1NAM02HT157; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT157; 
x-forefront-prvs: 05641FD966
x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT;
 SFP:1901; SCL:1; SRVR:SN1NAM02HT157; H:DM5PR13MB1596.namprd13.prod.outlook.com;
 FPR:; SPF:None; LANG:; 
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative;
 boundary="_000_DM5PR13MB159629F5A5A3B229022C7AD4F1E00DM5PR13MB1596namp_"
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e0cbfed1-747c-4318-926e-08d564e19d94
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2018 17:24:11.6034 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT157
X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.8 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 26 Jan 2018 12:37:36 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.8 (---)

--_000_DM5PR13MB159629F5A5A3B229022C7AD4F1E00DM5PR13MB1596namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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.

    #include <pthread.h>
    #include <libguile.h>

    void* hello_world(void *arg) {
        scm_c_eval_string("(display \"Hello World!\")");
        scm_c_eval_string("(newline)");
    }

    void run_guile() {
        scm_with_guile(&hello_world, NULL);
    }

    int main(int argc, char **argv) {

        pthread_t th;
        int ret =3D pthread_create(&th, NULL, &run_guile, NULL);

        run_guile();
        pthread_join(&th, NULL);

        return 0;
    }

Here is a backtrace of the issue.

    #0  0x00007ffff7afd976 in scm_set_current_dynamic_state () from /usr/li=
b/libguile-2.2.so.1
    #1  0x00007ffff7b5faec in guilify_self_2 () from /usr/lib/libguile-2.2.=
so.1
    #2  0x00007ffff7b604b4 in scm_i_init_thread_for_guile () from /usr/lib/=
libguile-2.2.so.1
    #3  0x00007ffff7b604f9 in with_guile () from /usr/lib/libguile-2.2.so.1
    #4  0x00007ffff7281312 in GC_call_with_stack_base () from /usr/lib/libg=
c.so.1
    #5  0x00007ffff7b60918 in scm_with_guile () from /usr/lib/libguile-2.2.=
so.1
    #6  0x00000000004007a3 in run_guile ()
    #7  0x00007ffff7893568 in start_thread (arg=3D0x7ffff5ea8700) at pthrea=
d_create.c:465
    #8  0x00007ffff75cb52f in clone () at ../sysdeps/unix/sysv/linux/x86_64=
/clone.S:95


--_000_DM5PR13MB159629F5A5A3B229022C7AD4F1E00DM5PR13MB1596namp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div>If the initial call to scm_with_guile is on a thread and in the main</=
div>
<div>thread at the same time, a segmentation fault occurs.</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;#include &lt;pthread.h&gt;</div>
<div>&nbsp;&nbsp; &nbsp;#include &lt;libguile.h&gt;</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;void* hello_world(void *arg) {</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scm_c_eval_string(&quot;(display=
 \&quot;Hello World!\&quot;)&quot;);</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scm_c_eval_string(&quot;(newline=
)&quot;);</div>
<div>&nbsp;&nbsp; &nbsp;}</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;void run_guile() {</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scm_with_guile(&amp;hello_world,=
 NULL);</div>
<div>&nbsp;&nbsp; &nbsp;}</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;int main(int argc, char **argv) {</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pthread_t th;</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int ret =3D pthread_create(&amp;=
th, NULL, &amp;run_guile, NULL);</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;run_guile();</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pthread_join(&amp;th, NULL);</di=
v>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return 0;</div>
<div>&nbsp;&nbsp; &nbsp;}</div>
<div><br>
</div>
<div></div>
<div>Here is a backtrace of the issue.</div>
<div><br>
</div>
<div></div>
<div>&nbsp;&nbsp; &nbsp;#0&nbsp; 0x00007ffff7afd976 in scm_set_current_dyna=
mic_state () from /usr/lib/libguile-2.2.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#1&nbsp; 0x00007ffff7b5faec in guilify_self_2 () fr=
om /usr/lib/libguile-2.2.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#2&nbsp; 0x00007ffff7b604b4 in scm_i_init_thread_fo=
r_guile () from /usr/lib/libguile-2.2.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#3&nbsp; 0x00007ffff7b604f9 in with_guile () from /=
usr/lib/libguile-2.2.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#4&nbsp; 0x00007ffff7281312 in GC_call_with_stack_b=
ase () from /usr/lib/libgc.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#5&nbsp; 0x00007ffff7b60918 in scm_with_guile () fr=
om /usr/lib/libguile-2.2.so.1</div>
<div>&nbsp;&nbsp; &nbsp;#6&nbsp; 0x00000000004007a3 in run_guile ()</div>
<div>&nbsp;&nbsp; &nbsp;#7&nbsp; 0x00007ffff7893568 in start_thread (arg=3D=
0x7ffff5ea8700) at pthread_create.c:465</div>
<div>&nbsp;&nbsp; &nbsp;#8&nbsp; 0x00007ffff75cb52f in clone () at ../sysde=
ps/unix/sysv/linux/x86_64/clone.S:95</div>
<div></div>
<div><br>
</div>
</body>
</html>

--_000_DM5PR13MB159629F5A5A3B229022C7AD4F1E00DM5PR13MB1596namp_--




Acknowledgement sent to Sheheryar Parvaz <skipper308@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#30261; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.