delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/12/17/15:52:31

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=SZt4JUWbsAmLVoxn
4SR0/yuhaj7o22suDW+qBG+hZPkSAeLPb0D5VDFQZpky6rTxHi0OoCKk4rjWRlPp
rqV2yA3TseZ2mt7xR657Uym5GtlSXHMxDtWWkz55C+wA+AhQUeYkOKibI/34hjth
NxnG/mvXZJBP12vH20JDmjm/UK4=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=Fw1VCD3fQVDUU1rDzNf7hm
k2hoU=; b=JRi9zGHUepD1VoXnTdt9Ffwlzwz//1ygbr6n/HpxhMt/9dT2q9UOcN
yTBMihO0alMm0abEOiJHOaUEjrhSgSTwlFs3mGIoyy/BeupZfRGBzegBxvRKLj8y
OQQf+SmSD1qSPon+NUnJM/ms4hNI7VCP56V2IFEqDmLRX8DqAsL2Y=
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-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=Effective, sysconfdir, 8.3.0, localstatedir
X-HELO: mail-wr1-f66.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=zcL+cob6fJ2aW+iCOT2pGFHv8LJ9+Oks1eCCWF3cY7o=; b=NNYnwGTSDdLCgqIPj/Qx6lwplvyGQuuqT8ADyhnk60kEclRjt02n30dELd4gwwUOAy eXk07JZeDTq/gTL8nr4YCxHkM8HsnpW6ObSMWCn9sMWOqJOZ8RLo+eqRw/GQcSKuytKl rVkXtwvL9HHFstIRVCNnQfuxnoRc+bBcd6rlHLf3IB67cpSsD91ljmH6QobpH1zQ+MON AyM0t4VQomXBYX0WQY/dxgz/1ROT9CC301n8ztK8NvV4xC4Nh+Lgew0j+HLitcApJk9o opEfbrPtF6kfS6HJOKsxEYPnJ+BKP/5CaPJM+BRkcXSOPa9KpRmvsvj21H8EoLH8hvWF ZSXg==
Subject: Re: [BUG] try..catch does not work if compiled with clang 8.0
To: cygwin AT cygwin DOT com
References: <CGME20191217093504eucas1p14cced4e1f9fcec50e44e9223d1761858 AT eucas1p1 DOT samsung DOT com> <000701d5b4bd$42c086f0$c84194d0$@samsung.com> <af3cb99f-f1cc-3bcc-9644-310c259eb222 AT SystematicSw DOT ab DOT ca>
From: =?UTF-8?Q?Csaba_R=c3=a1duly?= <rcsaba AT gmail DOT com>
Message-ID: <a9a62b50-688c-5747-266a-e7bb8157adbb@gmail.com>
Date: Tue, 17 Dec 2019 21:51:32 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <af3cb99f-f1cc-3bcc-9644-310c259eb222@SystematicSw.ab.ca>

On 17/12/2019 17:29, Brian Inglis wrote:
> On 2019-12-17 02:35, Pavel Fedin wrote:
>> I haven't upgraded for a while and today i finally decided to do so. After
>> rebuilding by project with clang++ 8.0 i found out that try...catch construct
>> doesn't work. The program just gets silently aborted.
>> Switched back to old clang++ 5.0 and it works.
>> Also an old bug which i reported some (a while) time ago persists: uncaught
>> throw does not print anything.
>> OS is Windows 10 x86/64.
> It is unlikely that try/catch does not work in the general case for clang++8,
> and your post has insufficient information to reproduce the problem.

a.k.a. https://www.chiark.greenend.org.uk/~sgtatham/bugs.html#respect

WJFFM

$ cat catcher.cpp
#include <stdexcept>
#include <iostream>

int pitcher()
{
	throw std::runtime_error{"Ouch"};
}

int main()
{
	try {
		return pitcher();
	}
	catch (std::exception const&e) {
		std::cout << "Caught a " << typeid(e).name() << " - " << e.what() << '\n';
		return 42;
	}
}

$ g++ -v -Wall -Wpedantic -Wextra -g  catcher.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: 
/cygdrive/i/szsz/tmpp/gcc/gcc-8.3.0-1.x86_64/src/gcc-8.3.0/configure 
--srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-8.3.0-1.x86_64/src/gcc-8.3.0 
--prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc 
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C 
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin 
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib 
--enable-shared --enable-shared-libgcc --enable-static 
--enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit 
--with-dwarf2 --with-tune=generic 
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite 
--enable-threads=posix --enable-libatomic --enable-libgomp --enable-libitm 
--enable-libquadmath --enable-libquadmath-support --disable-libssp 
--enable-libada --disable-symvers --with-gnu-ld --with-gnu-as 
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix 
--without-libintl-prefix --with-system-zlib --enable-linker-build-id 
--with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 8.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wpedantic' '-Wextra' '-g' '-shared-libgcc' 
'-mtune=generic' '-march=x86-64'
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/cc1plus.exe -quiet -v -idirafter 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib/../include/w32api -idirafter 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api 
catcher.cpp -quiet -dumpbase catcher.cpp -mtune=generic -march=x86-64 -auxbase 
catcher -g -Wall -Wpedantic -Wextra -version -o /tmp/cczG1NcE.s
GNU C++14 (GCC) version 8.3.0 (x86_64-pc-cygwin)
         compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, 
MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/include-fixed"
ignoring nonexistent directory 
"/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/include"
ignoring duplicate directory 
"/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/include/c++
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/include/c++/x86_64-pc-cygwin
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/include/c++/backward
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/include
  /usr/local/include
  /usr/include
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib/../include/w32api
End of search list.
GNU C++14 (GCC) version 8.3.0 (x86_64-pc-cygwin)
         compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, 
MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: bed998889edfd32f5c9a3f3c8baa420d
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wpedantic' '-Wextra' '-g' '-shared-libgcc' 
'-mtune=generic' '-march=x86-64'
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/bin/as.exe -v 
-o /tmp/ccCNGYho.o /tmp/cczG1NcE.s
GNU assembler version 2.29.1 (x86_64-pc-cygwin) using BFD version (GNU Binutils) 
2.29.1.20171006
COMPILER_PATH=/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib/../lib/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib/:/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wpedantic' '-Wextra' '-g' '-shared-libgcc' 
'-mtune=generic' '-march=x86-64'
  /usr/lib/gcc/x86_64-pc-cygwin/8.3.0/collect2.exe -plugin 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/cyglto_plugin.dll 
-plugin-opt=/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/lto-wrapper.exe 
-plugin-opt=-fresolution=/tmp/ccSrxYRN.res -plugin-opt=-pass-through=-lgcc_s 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcygwin 
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id -m 
i386pep --wrap _Znwm --wrap _Znam --wrap _ZdlPv --wrap _ZdaPv --wrap 
_ZnwmRKSt9nothrow_t --wrap _ZnamRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t 
--wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --tsaware 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib/crt0.o 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/crtbegin.o 
-L/usr/lib/gcc/x86_64-pc-cygwin/8.3.0 
-L/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib/../lib 
-L/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib -L/lib/../lib 
-L/usr/lib/../lib 
-L/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../x86_64-pc-cygwin/lib 
-L/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../.. /tmp/ccCNGYho.o -lstdc++ -lgcc_s 
-lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/../../../../lib/default-manifest.o 
/usr/lib/gcc/x86_64-pc-cygwin/8.3.0/crtend.o
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wpedantic' '-Wextra' '-g' '-shared-libgcc' 
'-mtune=generic' '-march=x86-64'

$ ./a.exe
Caught a St13runtime_error - Ouch

Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)

--
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