DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 60QNjwuh1836693 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 60QNjwuh1836693 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=P/HQclVu X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 079FE4BC8959 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1769471156; bh=ApGhTJfXAsVwMy25efIDDJqoXR9Lm4CMy2p16JI+u4E=; 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=P/HQclVuvHI4I6HQV2pGE45vs0svxFVV8+dv0Tc+4m68GjnaFYBzoKFAjTMjIL5LP ryrDwuhg0GOpkFxnN8RY0mUTr0D19nx/3Susz4CBLgIwvmr86uEnr+JshGdfV6EbKk GNARTOxSTME0GNyxmht9BOZlSvrZxZ41Iz6WW1BQ= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06EAC4BA2E29 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 06EAC4BA2E29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769471136; cv=none; b=itF8K4i50G8+tFHo78FGrFqCbMDWQIzlGN0yfUrLawp6wGOfWox2Cqi+g5UzJP/gLE/cIdCfAKW/9k9jhkd72xCoas6JJGlidnvPhP+lKYs+uwV63YJqV6XYOJmwZub7BIawFKa0r7gRZMwPFRHbCXrvnz4UzY1OR10i8csEINE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769471136; c=relaxed/simple; bh=jcYKIcjzRqItTqjetfGdRn3j8J3ZFY5tXdnd6vNVsLk=; h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature; b=HHfLU9mkXcccySGgwz5EZf0g5hB2WY3Q8kNrY+Idh++zjAWyysZ4G8n2EqKKRGQ/aePCWzOxjL36QxTo7LFJcjynmjjaM6ve3m3qwHu7cRf4hq8X8uaTncirdbxhzDNcd7ZKhEMsB63VAAM0XWyTlvuLdX2qDImVWLAmFGzBrVs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06EAC4BA2E29 Message-ID: Date: Mon, 26 Jan 2026 16:45:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Utterly perplexing change in behaviour Content-Language: en-CA To: cygwin AT cygwin DOT com References: <168f8b39-968b-1c82-1145-83a72ccc4ec8 AT cs DOT umass DOT edu> Organization: Systematic Software In-Reply-To: <168f8b39-968b-1c82-1145-83a72ccc4ec8@cs.umass.edu> X-Rspamd-Queue-Id: 21C4120025 X-Stat-Signature: okfgbqraqjppjq14nnx6mue6f4ex7163 X-Rspamd-Server: rspamout05 X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX1+AdVtPJ0sar5zxdC3VOKVq4I4j0b1aujg= X-HE-Tag: 1769471134-726785 X-HE-Meta: U2FsdGVkX1+fv2LLhiGrCeEmqXgidBLDYXcbTzdthRCoGuazMROZIcaUiDOWbBfCVjbMflQHWpN2F3N6maGYFPHt9ScNVsfp2hmUWGO2hdTpWVnL+kKiOW1FrpN3+OWE9uJpxtfb0AAYuZcXBRTJkDGfU5J5j5bouK1m4GDOHxDN59O9+eKGe+M04lOCaYlUt78auDLsmb6gSSWp1dNwPGzE7TAIc6HfRstc2bGf3+3VlWU9GlvW9+K1x36g/IQpL2tzau3ozK/9HA4RT4Uwz2lzVDK7t35P+3x9MpNsxornitu5/uxwmpun885J+AzvS6kwLZPc6PF+WFvvq6mx6mf4nddr6vl4 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Brian Inglis via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Brian Inglis Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 60QNjwuh1836693 On 2026-01-26 08:00, Eliot Moss via Cygwin wrote: > On 1/26/2026 9:48 AM, Fergus Daly via Cygwin wrote: >> This pertains to an external executable built within Cygwin and therefore not >> part of any Cygwin package so I am not expecting a "solution" >> but any illumination whatsoever, or similar experience, would be much >> appreciated. >> >> I use a standalone static statistical executable built within Cygwin from a >> collection of .c files using gcc. >> The resulting executable comprises many built-in functions and procedures >> ("routines"). >> Typically it would be used within the Cygwin environment where it is supported >> by large libraries of data files, Help files and call-able routines. >> But it is sophisticated enough to be useful within a directory containing just >> two files, itself myprog.exe and cygwin1.dll. >> So you could start it in a Command Prompt window with the command .\myprog >> with no need of Cygwin's larger architecture. >> >> It has a built-in function Cygwin() which returns the scalar 1 within Cygwin. >> (The identical collection of .c files may be used with gcc in Linux to build >> the equivalent executable for use in Linux. >> Then the function Cygwin() returns 0. There are cases where this distinction >> requires to be drawn.) >> This has been going for literally decades with trivial fixes and enhancements >> and surviving all advances over the years in cygwin1.dll >> or the Linux kernel and upgrades to gcc. >> >> As mentioned here a while ago the only glitch in its construction is that I >> have to use /lib/libreadline.a from v.8.1-2 [prev] not v.8.3-1 [curr] >> though I have not been able to pinpoint quite why. I just do the temporary >> workaround and then back again. >> >> Oh dear: sorry for this tedious preamble. Now to the point of this communication: >> >> Recently some common behaviours stalled, and it emerged that the function >> Cygwin() returned 0 not 1. >> This is astonishing because >> (a) I made no changes to the executable or to its environment. >> Well, I would say that, wouldn't I but .. .. >> (b) I could not recover the required functionality by reverting to an earlier >> version of cygwin1.dll; >> (c) the wrong output occurred on an old machine where W11 was not recently >> updated; and >> (d) the wrong output occurred on an even older machine running W10. >> All previously error-free. Unaltered executable !! Finally, even more >> incredibly bizarre: >> (e) I recompiled the executable twice in succession. With the same trigger, >> one version returned the value 1 as needed. The other again returned 0. >> >> I know. I know. Being of non-Cygwin origin; and with no access to the source >> collection; and with no oversight of my key-presses (especially at  (e)) >> this amounts to no more than a fringe anecdote. But it would be hugely >> encouraging to know of any similar experience of inexplicably changed behaviour >> (especially if recent) or any kind of a hint of cause or cure. >> >> Thank you for wading through all this .. .. > > Just a thought, prompted by decades of debugging experience ... > > Could this maybe have to do with uninitialized data, particularly some local > variable? > What's in a stack location would be whatever was left behind by some previous > function. > Also, while globals probably default to some standard value (e.g., 0) even if not > initialized, maybe that's not always true.  For example, I'm not sure what value > would > be in thread-local storage that is not explicitly initialized. > > I'm wondering if valgrind might be of assistance here in determining whether > reference > to uninitialized data may be happening.  (This would be valgrind's memcheck tool.) What approach are you using in Cygwin and Linux functions? I would recommend basing them on uname(3p) and sys_utsname.h(0p) in man-pages-posix for portability. -- 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 à retrancher 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