delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 9AD2638582B0 |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1706797465; | |
bh=PmODY8ncVQ8oYSMJwAprteeEGnBmTdOXCVRCR/b/5TU=; | |
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: | |
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: | |
From; | |
b=r1GLmtPaS+ozi9T4TJv/OJ7YSx7Roqd6Yo862aFNCs+/90rD1ux3Y7syanTh0YgsP | |
gLHXEulWuy2D0GzIGPQIaVvsnqbXUZEOQpNRkq4K9K3jCvgTL2Pk9yh8nRwZzO6OSQ | |
SywPFXfswZPDaDSq66AZLjfT/zkp23lf1ZTdis0M= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org 64E433858C2C |
ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org 64E433858C2C |
ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706797434; cv=none; |
b=tZZP8kuceftPCbamj5BiXz13bbq8OVX5kvPUHWhy5RoHHYQnI/9mJGiET2LDm0EIFDkLeTSe3fsjQVCR2JoeZXynRgb9e3Q0DNs/8k1fd2dRWeaQBeSqpg42d9ogoQZDIykfebzZIagYKoiL2Yq4Zy0iSfmwcGAgJu1z5Yw4WJw= | |
ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
t=1706797434; c=relaxed/simple; | |
bh=46LhqSOa4NxJegsVXdsVLytQmRLsfyGOzih5DfPqQ5E=; | |
h=Message-ID:Date:MIME-Version:From:Subject:To; | |
b=ZMzqXhBfyVxRH6gSjZ7qRUwR2QHEo2cwACSBYbx9u63h5Xs1pjF+8NIiWkmDHt9XdhFw21vTiI+lnVJHslYnqGmlJ57ga0cAxD23LHmoj7NoeHwaDS8EulB4Wq4vAWJCXDuGk/XNfBVqQ+ND08xs0KIB42CxC8tC5ikn2kfJI+c= | |
ARC-Authentication-Results: | i=1; server2.sourceware.org |
Message-ID: | <509b4b33-21ba-452b-a316-6346f482f026@systematicsw.ab.ca> |
Date: | Thu, 1 Feb 2024 07:23:48 -0700 |
MIME-Version: | 1.0 |
User-Agent: | Mozilla Thunderbird |
Subject: | Re: Aren't Windows System Error popups meant to be disabled in Cygwin? |
To: | cygwin AT cygwin DOT com |
References: | <CAJQQdJiOEduFeAthZ+q+LNXV33aJOhAXqq3sCaxdCqRpAjVmvA AT mail DOT gmail DOT com> |
<4aa47264-70df-42ff-bf74-70da021a8d82 AT SystematicSW DOT ab DOT ca> | |
<CAJQQdJg47_ouB+5tA5n8EBbmJj7VsqXF+hV9W5rRRbYVuxhGcQ AT mail DOT gmail DOT com> | |
Organization: | Systematic Software |
In-Reply-To: | <CAJQQdJg47_ouB+5tA5n8EBbmJj7VsqXF+hV9W5rRRbYVuxhGcQ@mail.gmail.com> |
X-Rspamd-Queue-Id: | 5B0D620026 |
X-Spam-Status: | No, score=-2.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, |
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, | |
SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, | |
UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 | |
X-Stat-Signature: | 6tie6kyjotmig8chqyjg74z6icrf3r3k |
X-Rspamd-Server: | rspamout05 |
X-Session-Marker: | 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 |
X-Session-ID: | U2FsdGVkX1/D4LME4yDiZPUBa6riRpQJSJh62Gt2eg0= |
X-HE-Tag: | 1706797429-925011 |
X-HE-Meta: | U2FsdGVkX19iEejpo2cOnz08T+FB9F5LixM9K4iTL+bIpfvAYjbm00SjhSIn+bZnne/hm/kg4nOWXZTC+2ZdRz144pxk64NADco20AUDAP4N302VBXmjj43QwU4RrqxdyyY+G6WQW5xQGWoFXsOBzTbNuZnruzrXRuCnkcx7ZVFNADlaCwgdLP418cZbzCehfup9JyoVOomxO2bNKg0xcNOILS0SHFE3WqmYLvQSawPHmYjvOsnNoPU0X/DPeYo8I+7mLqCET0DEbKV0RuKkM2zVa08TYL6DW+1jJuJU/x89xnQLaeJZ+7JlHLvwbIIgRgSXLggXH+GaQ6eRqIT7LwRJGivEJvrtyrLwdBQM7N7HmCiUKexZf6JZF0x7caM/5JYk8hAymYHcmblz077lr1WX8tTVGsZ6u3tSykYKZjUrQo05SnyvjuXUo0dJLAvvWdrqsLm3KF02wkn7hf4OlhPE+2xgvz59dMC9tIwZEw+I4hbuzEfKOLHcMK1T8MFbnAk0nW23AYTlBrjSOAa8FA== |
X-Spam-Checker-Version: | SpamAssassin 3.4.6 (2021-04-09) on |
server2.sourceware.org | |
X-BeenThere: | cygwin AT cygwin DOT com |
X-Mailman-Version: | 2.1.30 |
List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
List-Unsubscribe: | <https://cygwin.com/mailman/options/cygwin>, |
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe> | |
List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
From: | Brian Inglis via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | cygwin AT cygwin DOT com |
Cc: | Brian Inglis <Brian DOT Inglis AT systematicsw DOT ab DOT ca> |
Errors-To: | cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com |
Sender: | "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id 411EOR5m002768 |
On 2024-02-01 01:18, David Allsopp via Cygwin wrote: > On Wed, 31 Jan 2024 at 22:27, Brian Inglis via Cygwin wrote: >> On 2024-01-31 06:40, David Allsopp via Cygwin wrote: >>> Starting with this very trivial C program: >>> >>> #include <stdio.h> >>> #include <zstd.h> >>> >>> int main(void) { >>> printf("Zstandard v%d\n", ZSTD_versionNumber()); >>> } >>> >>> and compiling with >>> >>> x86_64-w64-mingw32-gcc -o test.exe test.c -lzstd >>> >>> when I then run ./test.exe, I get the Windows critical-error-handler >>> dialog stating "The code execution cannot proceed because >>> libzstd-1.dll was not found. Reinstalling the program may fix this >>> problem." >>> >>> My question is not how to fix the problem (I'm well aware of that), >>> but rather why that message is being displayed at all, and is it a bug >>> in Cygwin somewhere? All I could find Googling was previous >>> suggestions that Cygwin routinely calls SetErrorMode with, amongst >>> other things, SEM_FAILCRITICALERRORS with the intention of suppressing >>> this dialog. >>> >>> Is that correct, and if so is this just me? :o) >>> >>> Windows 10 22H2, Cygwin 3.4.10, running all the commands from mintty. >>> I also get the same popup if I run C:\cygwin64\bin\sh -c >>> "/cygdrive/c/path/to/test" either from a Command Prompt or even from >>> "Start -> Run". Running this via "sh" called from a non-Cygwin process >>> (itself invoked from a Command Prompt) which has also called >>> SetErrorMode is how I hit this. >> >> Better to let you know that there is a problem, and what the problem is, so you >> can fix it! > > Thank you, but no - as I made clear by: > >> My question is not how to fix the problem (I'm well aware of that) > > I'm fully aware what has caused the issue to arise, and how to fix it > - that's not the issue. The problem is that according to previous > messages, and the Cygwin code, my impression was that mintty / bash / > sh (*Cygwin* programs) calling this executable should be returning an > exit code here, not freezing on a message dialog. The problem appears > to be a bug in the Cygwin DLL, and from previous messages on the list, > my question is whether it's a regression, and can be fixed. > > The reason it's a problem is, say, a script _in Cygwin_ which is > handed a command to run, runs it, and is then completely blocked by > that popup dialog. It's the responsibility of the _caller_ (a Cygwin > program) to indicate the mode in which a program is executed - the > message box may be owned by the program called, but it's caused by it > being loaded, before it has a chance to run any code. > > My understanding, based on this line: > > https://github.com/cygwin/cygwin/blob/main/winsup/cygwin/dcrt0.cc#L721 > in dll_crt0_0 > > is that Cygwin executables (in this case mintty / bash / sh, etc.) > should be running with SEM_FAILCRITICALERRORS enabled, following the > best practice recommendations in > https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode > and that that setting should be correctly inherited by processes they > call (including non-Cygwin ones). > > Some ancient history, reporting my same issue in 2004: > https://cygwin.com/pipermail/cygwin/2004-March/115553.html and this > thread from 2006 > https://cygwin.com/pipermail/cygwin/2006-August/150038.html strongly > indicating that that line dcrt0.cc is there precisely to stop this > popup. I do not see the problem if a native MS Windows program is not properly installed with native MS Windows library dependencies and MS Windows displays a popup to inform the user of the missing dependency. Developer/maintainer/packager/distributor defects are never a downstream issue, they need to be addressed by the party who caused the failure! There seems to be a conflict here with some native MS Windows program users wanting those native MS Windows programs to be able start a debugger and others wanting a CLI failure message. ISTM if native MS Windows programs want specific native MS Windows behaviour, they should set that up before, at, or shortly after startup, as Cygwin does for its own programs, not rely on a foreign invoker doing so for them. Could those native MS Windows programs not be run from a native MS Windows shell or wrapper script to ensure the desired behaviour? Or just do not run native MS Windows programs, and find or build a Cygwin script or program to perform the desired function: that's the Cygwin way to avoid native MS Windows issues! ;^> -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |