delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/07/07/12:01:26

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:to:subject:from:in-reply-to
:references:mime-version:content-type:content-transfer-encoding;
q=dns; s=default; b=rAWXXvXjzs4FZvShUAQPQt8hDgJ/MJaGIumcmkDpl0Y
AncAFeT6mfpSwEIXsbdQMOzruBZ6TPLQAH06GjCJNKm47g1YuFn9gXDDHY7NHb7f
TEKtYJBkhRKbcqELwKuVn4h7qjLWALjnjEH+XiCgX4wjgYAcVp0DCF0JY3EchiHs
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:to:subject:from:in-reply-to
:references:mime-version:content-type:content-transfer-encoding;
s=default; bh=2o6LT/K9gZgOhJpmedZp9X23g/4=; b=fz9CxrRj1LdB2ldzZ
YVQ4X+0JG043ykrkOMEgRN7LG1fVtnYxY8lnL+4DRkeIkbjnK+J1nXPZ/Tr+XQZ7
DXde7g7cS3GOd4d1DYeJrP4h80GuDczX8sA87srbzUNsQKhg5+ijzjREGwwEpYPl
Ja36gQ5V7l/dXOFGCtqnWZWZLI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=cygwindevel, cygwin-devel, 2.8.0-1, H*x:version
X-HELO: msa02y.plala.or.jp
Date: Sat, 08 Jul 2017 01:01:01 +0900 (JST)
Message-Id: <20170708.010101.1912300612711199228.trueroad@trueroad.jp>
To: cygwin AT cygwin DOT com
Subject: Re: g++ std::map initializing raises segmentation fault.
From: Masamichi Hosoda <trueroad AT trueroad DOT jp>
In-Reply-To: <98ee2e33-2c7c-a4b3-d06d-f58a040c1619@gmail.com>
References: <CAL_02JDCzwkbqZOPnq+95662FqcnRm65z28jZNJ89Z-TyWw9eA AT mail DOT gmail DOT com> <CAL_02JDCzwkbqZOPnq+95662FqcnRm65z28jZNJ89Z-TyWw9eA_at_mail_dot_gmail_dot_com> <98ee2e33-2c7c-a4b3-d06d-f58a040c1619 AT gmail DOT com>
Mime-Version: 1.0
X-VirusScan: Outbound; msa02m; Sat, 8 Jul 2017 01:01:06 +0900

> On 07/07/2017 16:21, Ivan Gagis wrote:
>> I installed g++ 6.3.0-2 and still can reproduce the segfault :(.
>>
>> Br,
>> Ivan
>>
> 
> It seems due to the -std=c++11 restriction
> 
> $ g++ foo.cc
> 
> $ ./a.exe
> Hello World!
> 
> $ g++ -std=c++11 foo.cc
> 
> $ ./a.exe
> Segmentation fault (core dumped)



Even if g++ 6.3.0-2 with `-std=c++11`,
there is no problem if cygwin-devel-2.8.0-1 is installed.



```
$ uname -a
CYGWIN_NT-10.0 inspiron5559 2.8.1(0.312/5/3) 2017-07-03 14:11 x86_64 Cygwin

$ cygcheck -c cygwin-devel
Cygwin Package Information
Package              Version        Status
cygwin-devel         2.8.0-1        OK

$ g++ --version
g++ (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ g++ -std=c++11 foo.cc

$ ./a
Hello World!

$ g++ -std=gnu++11 foo.cc

$ ./a
Hello World!

$
```



However, if cygwin-devel-2.8.1-1 is installed, segmentation fault is raised.



```
$ uname -a
CYGWIN_NT-10.0 inspiron5559 2.8.1(0.312/5/3) 2017-07-03 14:11 x86_64 Cygwin

$ cygcheck -c cygwin-devel
Cygwin Package Information
Package              Version        Status
cygwin-devel         2.8.1-1        OK

$ g++ --version
g++ (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ g++ -std=c++11 foo.cc

$ ./a
Segmentation fault (core dumped)

$ g++ -std=gnu++11 foo.cc

$ ./a
Hello World!

$
```



So the cause is cygwin-devel-2.8.1-1 in my humble opinion.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019