delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/11/14/01:49:30

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:from:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; q=dns; s=
default; b=ugI/X533nfetcOdlrgV0cKwyjrBnUsSeSbLY82qGquR1QI2G1j3OW
UvigqwisSg2nFPS3Jsaby2N6VYqc0ZdkjQPczRDj4VrR9a3S70eO3Iglw+/gUFzQ
6fmhMQoQfuOEPG/ElJHmwGGiq42GEbDesedu2SbleHgYOmObxeibng=
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:from:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; s=default;
bh=f7pNvWuOrrqA/uNbaFRFpEFYuII=; b=GRZFfGnGSBqtCe+/lD6QLuYr4WJK
2QGf6rw2FAJvr+yipIC6dijI8j0Q6Wnm1rDn/h7xNgMzVzC1tgE86p/U106g0kHJ
P1eU5bUPaBm8yrf8dDmrWpNUYWlHUz7akxhyxmVWf4v7toY4doRTAJ8lHimfiOOv
blEepjxszIURNC0=
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=-3.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=vocal, shy, resulted
X-HELO: nihcesxway6.hub.nih.gov
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1573714104; x=1605250104; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=8jPjYu5Z4AzNozxs4SnBuTKhta4DH7twt7OzD9mahqY=; b=GVPxKPpyqvtWkS6VTbzLOBQ4TLG08NkvkkvgVxK3buBIGQq4xSHBW5uZ MwfFhOUb4IyTkQ8Z4pgRWiHAWQhxfNdclCNhpvzqXmvv/B8+KubAP87bM +ASQ1f9cQ6vibx35XTwN48Of1JP8q5+QkT5gKfOPiW45GVyQiYi+F0H0I SZBG8hBFN7j64/NI6FFvOwBmr78juTb6ZszwGVrhm4jiBZ18qZ6VrWQMI YTDE+wlfj10+xbIhTasOlp/0LQWasx7crlSf1grDGRfgB9f1Vv53WQniW PYNh3rEs5LTf6yk/9lCtHidRYDcI/lfiuaroHettgP2McEydUpjB2ksLJ g==;
IronPort-SDR: BXuoNe53nbIs0sHzhtsRCQBqRCvw4Yk/SjcpFencLusbNrjg77XK9Gi9XnYwd0X0aXB/McDt9Y AfFQ/naoZHYA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hW/JR3iVfbG1aw2Mud3kQ3FGOVgakSLaYz25c6a6u+tr7rc3SGVRj0krDGQzI2s2p1dQaOnGcr7hySKyCAVhYegOnGrAaOc1EvySc7Ubi+ZVChKEUS19LsdiDw3qdxeM9T41gUSI8c/75RLIolfNWy6MvFyFSek5DAxTjUqJDJ8HCF0Pk7VU+wqamH0EQyaBoyPw1Q7i7SOD5Z1lSrbaikMO/FfJ3/Ih1AB+kI9NZp9tQ6Dx3uXL/CANteLHyzztL+vv0KHqODTEav5HtD3xXZNtzkEFlXpi8t8FSzqVPGcpViBUbFxRfmE5j7R00wGPYOZsg8rAvjDsICTuCWJLGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8jPjYu5Z4AzNozxs4SnBuTKhta4DH7twt7OzD9mahqY=; b=Y4U/YvmE2Lynl3JmB4gZ5yfuhkxqvvv/19rH/af2yQn2Ti8BnbJfbOHp596z5mWlB/OlBG8xFQDMWwegTf4gxvhS+RXAKFBQbT+PmDeb6JssJNfvRLR7JC8HC/1SkO2Py/Yk3Ei+ggiC4PDYqLHXKqdjDbbbHkbmIfYpXhsuyhWehfi5S4VaSiKORsYv1jNcl9G1P2ISzdFZFq/WT3PAM5m3Oowc9BtE2/7/B/O/dMGZKfTklTtZzv/c0qpYLiS9a+7/3gXW5V72735tpzfddxEG7QXOj1AI9cOcSQW7zAhYzU1gu5JSMdRfv9vhS+qONyPtKLZkTd1M0msSXdvmLw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector2-nih-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8jPjYu5Z4AzNozxs4SnBuTKhta4DH7twt7OzD9mahqY=; b=i4RJrwSN26dsHFD8VxB9hnijUTJMYW/bPb9crqRdPFjGbAG+SkMyQPPOD7d+5thM77+05P1bNGN/AIGfm3W3F9ip8cyHhBPVPqEt0LRTC25rf8bH/kSI3BkvyltUSvIRwNXtqFsbshwozQuFj1b60Uowayo01d7mrhdd8gmyagQ=
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin AT cygwin DOT com>
Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Question about executable startup failure
Date: Thu, 14 Nov 2019 06:48:20 +0000
Message-ID: <MN2PR09MB39650609A15AEC36C24F3614A5710@MN2PR09MB3965.namprd09.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr AT ncbi DOT nlm DOT nih DOT gov;
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: CAo662jd0f+AMk6MzZGx1oKyPlKA/qdUIoo7U0x3JaCdQC0/F1ZuqD+CdLtqgDXR
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id xAE6nCJt032074

Hi all,

Here's a situation: I have a binary that was built (from a C source code) with Cygwin 3.0.7 but "accidentally" used with much older Cygwin 2.11.2.

The binary won't actually launch.  Instead, it most uneventfully (silently, no crash - no drama) exits with an exit code of 127, meaning "command not found".  The same exit code would have resulted from any mistyped command, which shell couldn't recognize / locate a matching file for (yet it won't be shy of saying so).

When I start the binary under debugger, I see the following:

[New Thread 12576.0x4d70]
[New Thread 12576.0x4860]
[New Thread 12576.0x44b8]
[New Thread 12576.0x4528]
[Thread 12576.0x44b8 exited with code 3221225785]
[Thread 12576.0x4860 exited with code 3221225785]
During startup program exited with code 0xc0000139.

So there's actually an explanation:  0xc0000139(=3221225785) is defined to be

ntstatus.h:#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139)

Now, the question is:  is it by design that the exit code is posted so timidly?  Shouldn't there be a message that some dynamic linkage wasn't satisfied?
Wouldn't 126 (which is "command cannot execute") be a better choice for the exit code in this case?  Especially if the message cannot be produced at all?

I mean, it is actually a good thing that the executable won't start if it happens to be incompatible with some random Cygwin version;  it just needs to be more vocal about the problem and post a more appropriate exit code, too.

Thanks,
Anton

P.S. I didn't get to know what exactly the entry point was missing that the binary required (obviously from the newer Cygwin ABI).

Reference:
https://pubs.opengroup.org/onlinepubs/9699919799//utilities/V3_chap02.html#tag_18_08_02
If a command is not found, the exit status shall be 127. If the command name is found, but it is not an executable utility, the exit status shall be 126. Applications that invoke utilities without using the shell should use these exit status values to report similar errors.

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