From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 4BC583858C2F for ; Sat, 2 Jul 2022 14:29:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BC583858C2F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinwoodie.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinwoodie.org Received: by mail-wm1-x32f.google.com with SMTP id k129so2891444wme.0 for ; Sat, 02 Jul 2022 07:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dinwoodie.org; s=google; h=date:from:to:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to; bh=aDdvi40DZuvoGzXFO6J6FxiZOpUTn05R9JtYfju7ezU=; b=hu10PYDRtqIgz1TV6dOxtO5KzJ0R4TVE1jov43sa2O4VwRP2oweGSvQ9VLLeaguqyW ZGEmllXkHQXlhcQf/chXKLeophk61sxq32hGgq+CzYzVTnDqxnopJM908v4NDJdQCasZ y/Rmnns+VRiIr9mCFTDouSsn6eSwl3OWgdkyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to; bh=aDdvi40DZuvoGzXFO6J6FxiZOpUTn05R9JtYfju7ezU=; b=QF1N4liG/EGMeM2UzcdLZ8qozTIt5hoz3FRstv4qpRubLJEuXpLjNZc5hY6QTdGhPr qxUHGfcOXAKyeHhKrmZ3oghMDah28XpnHHOROW1GcfvkpwtRjkd6PxIaHn5FQfELo6O9 zJVUAzLhGIFL78Ag3OoPKxK+KLBUKKTsQK+36k4j2NGzvrCvpRlL7VmkzsitGExNFLiM 39A8f3OrVAc+CJ5RTP0hvwQuINA1SA3jAx+AX0J3FlCuSiU9i1pwli/v+TPAGZgXeRNP B+qyYiwja0btenElVmIcz1KjmzcLrh33OqLkXrr8CwJuJwRtiHkWvU8NOb2FIhIEEouF oA9Q== X-Gm-Message-State: AJIora95PtamB+K6oA7e0hKJHU5Vq/Dq6jbr8yXpIyk4oJSJ6nrG4VtG WO/lfVyFN4my/QlcJO98TBuD9FpF5VLMAX8u X-Google-Smtp-Source: AGRyM1tp7k3FqBw2xuG087c9F9/HgOZde70et0jxsoEp9VrrZY0DSNAXm89DtE22Lwqjno1jf72O5g== X-Received: by 2002:a05:600c:2315:b0:3a1:772e:b9a6 with SMTP id 21-20020a05600c231500b003a1772eb9a6mr18389259wmo.34.1656772178978; Sat, 02 Jul 2022 07:29:38 -0700 (PDT) Received: from lucy.dinwoodie.org (b.8.0.0.8.9.b.0.2.f.0.9.2.a.d.b.d.a.0.2.5.1.e.d.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:de15:20ad:bda2:90f2:b98:8b]) by smtp.gmail.com with ESMTPSA id m2-20020adffa02000000b0021d163daeb0sm19135526wrr.108.2022.07.02.07.29.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 07:29:38 -0700 (PDT) Received: from adam by lucy.dinwoodie.org with local (Exim 4.94.2) (envelope-from ) id 1o7e7t-002QCc-8P for cygwin@cygwin.com; Sat, 02 Jul 2022 15:29:37 +0100 Date: Sat, 2 Jul 2022 15:29:37 +0100 From: Adam Dinwoodie To: cygwin@cygwin.com Subject: Re: Unexpected zero return code from `throw std::runtime_error` Message-ID: <20220702142937.eonexfklt77kygps@lucy.dinwoodie.org> Reply-To: cygwin@cygwin.com References: <20220702132158.g6u7wo2lnokgezoc@lucy.dinwoodie.org> <426b02170703066d930c6f3a81f3ef9e686f69b6.camel@Askesis.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <426b02170703066d930c6f3a81f3ef9e686f69b6.camel@Askesis.nl> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2022 14:29:41 -0000 On Sat, Jul 02, 2022 at 04:14:51PM +0200, Joost Kraaijeveld wrote: > Hi, > > The exception is not handled by the program. In that case "[[noreturn]] > void std::terminate()" is called by the C++-runtime. std::terminate > calls the currently installed std::terminate_handler. The default > std::terminate_handler calls std::abort. After calling std::abort an > implementation defined status is returned to the host environment that > indicates unsuccessful execution. > > So basically both programs do the right thing. I'm not sure if we're talking at cross purposes here. My expectation was exactly what you describe: after hitting the error, I was expecting to see a non-zero return code from the compiled executable, that being the expected "implementation defined status ... that indicates unsuccessful execution". The problem I am trying to report / get help with is that, in my simple test case, the exit status is 0, which on Cygwin I would interpret to mean *successful* execution.