From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124549 invoked by alias); 7 Jul 2017 16:01:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 124526 invoked by uid 89); 7 Jul 2017 16:01:11 -0000 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 Received: from msa02.plala.or.jp (HELO msa02y.plala.or.jp) (58.93.240.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Jul 2017 16:01:09 +0000 Received: from msc01.plala.or.jp ([172.23.12.31]) by msa02y.plala.or.jp with ESMTP id <20170707160106.IKCJ11847.msa02y.plala.or.jp@msc01.plala.or.jp> for ; Sat, 8 Jul 2017 01:01:06 +0900 Received: from localhost ([60.34.228.247]) by msc01.plala.or.jp with ESMTP id <20170707160106.FNMC16673.msc01.plala.or.jp@localhost> for ; Sat, 8 Jul 2017 01:01:06 +0900 Date: Fri, 07 Jul 2017 16:01:00 -0000 Message-Id: <20170708.010101.1912300612711199228.trueroad@trueroad.jp> To: cygwin@cygwin.com Subject: Re: g++ std::map initializing raises segmentation fault. From: Masamichi Hosoda In-Reply-To: <98ee2e33-2c7c-a4b3-d06d-f58a040c1619@gmail.com> References: <98ee2e33-2c7c-a4b3-d06d-f58a040c1619@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; msa02m; Sat, 8 Jul 2017 01:01:06 +0900 X-SW-Source: 2017-07/txt/msg00116.txt.bz2 > 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