bash shell script: recently running, now failing

2023-04-05 Thread Fergus Daly via Cygwin
I have a "hash bang" bash shell script i.e. first line
#! /bin/sh
or equivalently
#! /bin/bash
For various reasons I want this file to be identified as binary so its second 
line
is the single character null \x00 showing up in some editors e.g. nano as
 ^@
This does not prevent the script from running to a successful conclusion.
Or not until recently. Now the script fails with
/home/user/bin/file.old.sh: cannot execute binary file
Q1 - was bash recently updated? Would this explain the changed behaviour?
Q2 - if so, is this newly introduced "glitch" known and presumably intended? Or
an unintended consequence that will be retracted in a later update? 
I then altered the first line to
#! /bin/dash
whilst retaining the null character at line 2 and subsequent content also 
unaltered..
The altered script file.new.sh runs as previously to a successful conclusion.
Q3 - at 1/8 the size of bash and sh, I am not at all sure of the role and reach 
of dash.
Should the edit (dash replacing bash/sh) be incorporated elsewhere or would 
this be a
bad idea (and retained only locally in what is indeed an eccentric and one-off 
context)?


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


[ANNOUNCEMENT] discus 0.5.0-1

2023-04-05 Thread Andrew Schulman via Cygwin-announce via Cygwin
discus 0.5.0-1 is now available in Cygwin. This is a new upstream release,
with a minor bug fix. See the upstream changelog[1] for details.

discus is a pretty version of the df(1) command. It adds features such as
color, graphs, and smart formatting of numbers (automatically choosing the
most suitable size from kilobytes, megabytes, gigabytes, or terabytes). If
you don't want discus deciding the best sizes, you can also choose your own
increments, along with specifying the number of decimal places you'd like
to see.

Home page: https://github.com/ncarrier/discus

Andrew E. Schulman

[1]https://github.com/ncarrier/discus/blob/master/changelog


***


To update your installation, click on the "Install Cygwin now" link on
the http://cygwin.com/ web page. This downloads setup.exe to your
system. Then, run setup and answer all of the questions.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain.com_at_cygwin.com

If you need more information on unsubscribing, start reading here:

http://cygwin.com/lists.html#subscribe-unsubscribe

Please read *all* of the information on unsubscribing that is available
starting at this URL.

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


discus 0.5.0-1

2023-04-05 Thread Andrew Schulman via Cygwin-announce
discus 0.5.0-1 is now available in Cygwin. This is a new upstream release,
with a minor bug fix. See the upstream changelog[1] for details.

discus is a pretty version of the df(1) command. It adds features such as
color, graphs, and smart formatting of numbers (automatically choosing the
most suitable size from kilobytes, megabytes, gigabytes, or terabytes). If
you don't want discus deciding the best sizes, you can also choose your own
increments, along with specifying the number of decimal places you'd like
to see.

Home page: https://github.com/ncarrier/discus

Andrew E. Schulman

[1]https://github.com/ncarrier/discus/blob/master/changelog


***


To update your installation, click on the "Install Cygwin now" link on
the http://cygwin.com/ web page. This downloads setup.exe to your
system. Then, run setup and answer all of the questions.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain.com_at_cygwin.com

If you need more information on unsubscribing, start reading here:

http://cygwin.com/lists.html#subscribe-unsubscribe

Please read *all* of the information on unsubscribing that is available
starting at this URL.


Re: Mintty terminal crashes after changing the default home via nsswitch.conf and launch in a new profile in Windows 11

2023-04-05 Thread Yuta SUZUKI via Cygwin
Thomas and Brian,

Thank you for your replies.

> Please also cross-test with another terminal, e.g. rxvt, or xterm (after 
> running an X server).
--- I tried Cygwin/X in the same procedure. I tried only xterm but
then I found a clearer problem:
After I launch XWin server, I got no response for
"Right-clicking on the "X applications menu" icon in the notification area".
Also, almost all windows get hung up (no normal response for GUI actions).
I can use only keyboard actions to manipulate applications.
Of course, again, signout & re-signin solve the problem completely.
Once I got some warning message, saying "please contact cygwin
developers" or like,
but I couldn't reproduce it and I didn't screenshot it... It said
"/tmp/... is locked" or something similar.

> Are you sure that Windows setup, update, AV update, Edge update, and all the 
> ...
--- The signout & re-signin can be done very quickly, which solves the problem
and so I don't think such applications disturbing the environment.
Also, I found the issue in my lab, but now testing in my private machine,
which is not connected to domain network.

Also, I found that to reproduce the mintty terminal hung up,
it's better to click the blank (I mean black part) part of the terminal window,
not the upper edge of the window. (Then the cursor stops blinking,
which is strange.)

Yours,
Yuta

2023年4月6日(木) 4:55 Brian Inglis :
>
> On 2023-04-04 20:56, Yuta SUZUKI via Cygwin wrote:
> > Thank you for your reply.
> > But I can't get the point so much...
>
> >> This setting example is only a suggestion, not meant to be used verbatim, 
> >> and
>
> > --- Yes. In my lab, I use another path for the default home. This is
> > just a simple test configuration.
>
> >> means that, for each Windows account at setup or login, under the user's 
> >> Windows
> >> home directory, you will create a literal "cygwin" subdirectory, to be 
> >> mounted
>
> >  I think that usually cygwin automatically makes the directory
> > assigned as the default home in nsswitch.conf (and indeed it does).
> > I tried the same experiment with making C:\Users\test\cygwin manually
> > before launching cygwin, but the same crash is reproduced.
>
> >> When you change this field from the default, it is up to you to understand 
> >> and support the setting.
>
> >  Well, I know that I want to assign the home directory
> > automatically to every user of my lab.
> > I don't know the internal structure of cygwin and so what I can do is
> > to only announce
> > "Do not use cygwin at your very first sign-in to the machine.
> > Re-sign-in before launching cygwin".
> > But I think this is a bit ridiculous...
>
> Perhaps wait until account initialization is complete before starting Cygwin
>
> >> Cygwin startup is probably waiting for an automounter to provide the 
> >> directory here,
>
> >  Actually, in my experiment, cygwin does make the directory
> > C:\Users\test\cygwin
> > and even I could output cygcheck to C:\Users\test\cygwin\foo.out (or
> > /cygdrive/c/test/foo.out).
> > The problem is only in the crash of the window system.
> > Addendum:
> > Setting Windows environment variable HOME to be /cygdrive/c/users/test
> > works without the issue,
> > but it does affect another application in my lab as documented in
> > cygwin's users guide.
> Are you sure that Windows setup, update, AV update, Edge update, and all the
> other junk Windows runs has completed, and the account has been logged in, and
> that account setup has completed, before you start installing Cygwin, and 
> before
> you start running Cygwin?
>
> Also be aware that if you are on a domain, to top process in each Cygwin 
> process
> tree has to access the ADC to load up all the AD related info including all 
> the
> group memberships and rights for the user.
> This can takes seconds to minutes, if the ADC is not on a close, fast LAN 
> link.
> So wait until you see a Cygwin shell prompt before trying anything.
>
> Perhaps try with a more lightweight app like cmd, rather than File Explorer,
> which easily locks up systems.
> Normally switching to TaskMgr, seeing the issue with, and killing the File
> Explorer process tree, resets the system, and restarts File Explorer.
>
> During testing, switch to TaskMgr and check resource usage and waits to see 
> what
> is actually causing the issue.
> It is often an app in Cygwin's BLODA Big List Of Dodgy Apps:
>
> https://cygwin.com/faq/faq.html#faq.using.bloda
>
> a "dodgy" app, often an AntiVirus, Malware, or other monitor, that is not
> written well enough to do its job without interfering with other apps.
>
> This especially applies to Cygwin as it has to work around Windows limitations
> at a low level to implement POSIX compatible syscalls, and AV and monitoring
> applications are not always well written.
>
> Do you have any such software operating on these systems, what is it, is it in
> our BLODA list; what is the system resource usage and what is in wait states
> when the issue 

Re: Mintty terminal crashes after changing the default home via nsswitch.conf and launch in a new profile in Windows 11

2023-04-05 Thread Brian Inglis via Cygwin

On 2023-04-04 20:56, Yuta SUZUKI via Cygwin wrote:

Thank you for your reply.
But I can't get the point so much...



This setting example is only a suggestion, not meant to be used verbatim, and



--- Yes. In my lab, I use another path for the default home. This is
just a simple test configuration.



means that, for each Windows account at setup or login, under the user's Windows
home directory, you will create a literal "cygwin" subdirectory, to be mounted



 I think that usually cygwin automatically makes the directory
assigned as the default home in nsswitch.conf (and indeed it does).
I tried the same experiment with making C:\Users\test\cygwin manually
before launching cygwin, but the same crash is reproduced.



When you change this field from the default, it is up to you to understand and 
support the setting.



 Well, I know that I want to assign the home directory
automatically to every user of my lab.
I don't know the internal structure of cygwin and so what I can do is
to only announce
"Do not use cygwin at your very first sign-in to the machine.
Re-sign-in before launching cygwin".
But I think this is a bit ridiculous...


Perhaps wait until account initialization is complete before starting Cygwin


Cygwin startup is probably waiting for an automounter to provide the directory 
here,



 Actually, in my experiment, cygwin does make the directory
C:\Users\test\cygwin
and even I could output cygcheck to C:\Users\test\cygwin\foo.out (or
/cygdrive/c/test/foo.out).
The problem is only in the crash of the window system.
Addendum:
Setting Windows environment variable HOME to be /cygdrive/c/users/test
works without the issue,
but it does affect another application in my lab as documented in
cygwin's users guide.
Are you sure that Windows setup, update, AV update, Edge update, and all the 
other junk Windows runs has completed, and the account has been logged in, and 
that account setup has completed, before you start installing Cygwin, and before 
you start running Cygwin?


Also be aware that if you are on a domain, to top process in each Cygwin process 
tree has to access the ADC to load up all the AD related info including all the 
group memberships and rights for the user.

This can takes seconds to minutes, if the ADC is not on a close, fast LAN link.
So wait until you see a Cygwin shell prompt before trying anything.

Perhaps try with a more lightweight app like cmd, rather than File Explorer, 
which easily locks up systems.
Normally switching to TaskMgr, seeing the issue with, and killing the File 
Explorer process tree, resets the system, and restarts File Explorer.


During testing, switch to TaskMgr and check resource usage and waits to see what 
is actually causing the issue.

It is often an app in Cygwin's BLODA Big List Of Dodgy Apps:

https://cygwin.com/faq/faq.html#faq.using.bloda

a "dodgy" app, often an AntiVirus, Malware, or other monitor, that is not 
written well enough to do its job without interfering with other apps.


This especially applies to Cygwin as it has to work around Windows limitations 
at a low level to implement POSIX compatible syscalls, and AV and monitoring 
applications are not always well written.


Do you have any such software operating on these systems, what is it, is it in 
our BLODA list; what is the system resource usage and what is in wait states 
when the issue occurs?


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


Re: Mintty terminal crashes after changing the default home via nsswitch.conf and launch in a new profile in Windows 11

2023-04-05 Thread Thomas Wolff via Cygwin



Am 04.04.2023 um 17:13 schrieb Yuta SUZUKI via Cygwin:

Hi,

I am recently setting up the computer room of my faculty
and then encountered the following issue:

Short description:
Change the default home directory via
/etc/nsswitch.conf
and make a new Windows user.
Login to the new user (and do not logout) and launch cygwin.
After opening another application's window, e.g. Explorer,
and try to switch the focus between the cygwin window and the other window.
After once or twice of switch, switching is not smooth
and both the cygwin and the other application seem freezing.
(Still we can launch powershell to restart the machine.)

Procedure to reproduce the issue:
1. Login as an administrator.
2. Install cygwin with the default configuration.
3. In C:\cygwin64\etc\nssswitch.conf, replace
# db_home:  /home/%U
to
db_home: /%H/cygwin
and save the file.
4. Create a new Windows user, say "test", without Microsoft account.
5. Logout from the administrator user used so far.
6. Login as the user "test". (Do not logout in the remaining steps.)
7. Launch cygwin from the desktop icon.
8. Run cygcheck -s -v -r > cygcheck_before_crash.out (to reproduce the
issue, this step is unnecessary.)
9. Open a window of the Explorer.
10. Click the cygwin window. This does not switch the focus to the focus...
11. Click the cygwin icon in the task bar. Probably it switches the window.
12. Run cygcheck -s -v -r > cygcheck_after_crash.out (to reproduce the
issue, this step is unnecessary.)
13. Click the Explorer window. This does not switch the focus to the focus...
14. Click the "x" mark on the top right of the cygwin window. This
does not close the window...
16. Close the cygwin from the task bar. Probably it closes the window.

For me, the behaviour in the step 11, 14, 15 are rather troublesome.
If the situation is worse, then I cannot even use the start menu to
turn off the machine.
In such a case, still I could launch PowerShell with keyboard and run
Restart-Computer -Force
to restart the machine.

Note that if you logout and re-login after the step 6
or if you are using Windows 10, then the issue is not reproduced.

Environment:
Edition Windows 11 Home
Version 22H2
Installed on ‎3/‎29/‎2023
OS build 22621.1413
Experience Windows Feature Experience Pack 1000.22639.1000.0

I attach the above two log files.
(Some Japanese is included, sorry: some translations are
"なし" = "not applicable"
and
"ローカル アカウント" = "local account")

I would appreciate it very much if someone would solve this issue.

Yours,
Yuta Suzuki
First, the symptoms you describe are not a "crash". Is the terminal 
actually still responsive (even if with delay)?

I cannot reproduce such an issue.
Please also cross-test with another terminal, e.g. rxvt, or xterm (after 
running an X server).

Thomas

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


Re: Fwd:

2023-04-05 Thread cygwinautoreply--- via Cygwin
>-- Forwarded message -
>From: addycrown 
>Date: Tue, Apr 4, 2023 at 3:18 PM
>Subject:
>To: 


>http://Error:%20%20%20%20%20%20%200%20%5bmain%5d%20bash%2022288%20find_fast_cwd%3a%20warning%3a%20couldn%27t%20compute%20fast_cwd%20pointer.%20%20please%20report%20this%20problem%20to%20error%3a%20the%20public%20mailing%20list%20cyg...@cygwin.com/

>http://Error:%20%20%20%20%20%20%200%20%5bmain%5d%20bash%2022288%20find_fast_cwd%3a%20warning%3a%20couldn%27t%20compute%20fast_cwd%20pointer.%20%20please%20report%20this%20problem%20to%20error%3a%20the%20public%20mailing%20list%20cyg...@cygwin.com/

>Error:   0 [main] bash 22288 find_fast_cwd: WARNING: Couldn't compute
>FAST_CWD pointer.  Please report this problem to
>Error: the public mailing list cygwin@cygwin.com

>Error:   0 [main] bash 22288 find_fast_cwd: WARNING: Couldn't compute
>FAST_CWD pointer.  Please report this problem to
>Error: the public mailing list cygwin@cygwin.com
>Info: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
>Info: Resetting and pausing target processor: OK
>Info: Reading System ID at address 0x00102398:
>Info: ID value does not match: read 0x; expected 0x4546FEF8
>Info: Timestamp value verified
>Info: Warning: The software you are downloading may not run on the system
>which
>Info: is currently configured into the device.
>Info: No EPCS registers found: tried looking at addresses
>Info:  0x00101800, 0x00101900, 0x00101A00, 0x00101B00 and 0x00101C00
>Info: Leaving target processor paused
>Error:   0 [main] bash 36948 find_fast_cwd: WARNING: Couldn't compute
>FAST_CWD pointer.  Please report this problem to
>Error: the public mailing list cygwin@cygwin.com
>Error: Error code: 8 for command: nios2-flash-programmer
>"C:/altera/New_BootLooder/flash/Modulus_epcs_controller.flash"
>--base=0x101800 --epcs --sidp=0x102398 --id=0x4546FEF8 --accept-bad-sysid
>--device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]'
>--program


>Ademoye, T. Adesola, PhD.

>*The fear of God is the beginning of wisdom*




>Ademoye, T. Adesola, PhD.

>*The fear of God is the beginning of wisdom*


https://cygwin.com/faq.html#faq.using.fixing-find_fast_cwd-warnings

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


Fwd:

2023-04-05 Thread addycrown via Cygwin
-- Forwarded message -
From: addycrown 
Date: Tue, Apr 4, 2023 at 3:18 PM
Subject:
To: 


http://Error:%20%20%20%20%20%20%200%20%5bmain%5d%20bash%2022288%20find_fast_cwd%3a%20warning%3a%20couldn%27t%20compute%20fast_cwd%20pointer.%20%20please%20report%20this%20problem%20to%20error%3a%20the%20public%20mailing%20list%20cyg...@cygwin.com/

http://Error:%20%20%20%20%20%20%200%20%5bmain%5d%20bash%2022288%20find_fast_cwd%3a%20warning%3a%20couldn%27t%20compute%20fast_cwd%20pointer.%20%20please%20report%20this%20problem%20to%20error%3a%20the%20public%20mailing%20list%20cyg...@cygwin.com/

Error:   0 [main] bash 22288 find_fast_cwd: WARNING: Couldn't compute
FAST_CWD pointer.  Please report this problem to
Error: the public mailing list cygwin@cygwin.com

Error:   0 [main] bash 22288 find_fast_cwd: WARNING: Couldn't compute
FAST_CWD pointer.  Please report this problem to
Error: the public mailing list cygwin@cygwin.com
Info: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Info: Resetting and pausing target processor: OK
Info: Reading System ID at address 0x00102398:
Info: ID value does not match: read 0x; expected 0x4546FEF8
Info: Timestamp value verified
Info: Warning: The software you are downloading may not run on the system
which
Info: is currently configured into the device.
Info: No EPCS registers found: tried looking at addresses
Info:  0x00101800, 0x00101900, 0x00101A00, 0x00101B00 and 0x00101C00
Info: Leaving target processor paused
Error:   0 [main] bash 36948 find_fast_cwd: WARNING: Couldn't compute
FAST_CWD pointer.  Please report this problem to
Error: the public mailing list cygwin@cygwin.com
Error: Error code: 8 for command: nios2-flash-programmer
"C:/altera/New_BootLooder/flash/Modulus_epcs_controller.flash"
--base=0x101800 --epcs --sidp=0x102398 --id=0x4546FEF8 --accept-bad-sysid
--device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]'
--program


-- 
Ademoye, T. Adesola, PhD.

*The fear of God is the beginning of wisdom*




-- 
Ademoye, T. Adesola, PhD.

*The fear of God is the beginning of wisdom*

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


[ANNOUNCEMENT] fish 3.6.1-1

2023-04-05 Thread Andrew Schulman via Cygwin-announce via Cygwin
fish 3.6.1-1 is now available in Cygwin. This is a new upstream release,
with minor improvements and bug fixes. See the upstream release notes[1] for
a list of changes.

Also in this release, the fish documentation has been moved into a separate
package, fish-doc. The same documentation is available online at the fish
site[2].

fish is the friendly interactive shell. It's a Unix shell that focuses on
interactive use, discoverability, and user friendliness. The design goal of
fish is to give the user a rich set of powerful features in a way that is
easy to discover, remember, and use.

Home page: https://fishshell.com

Andrew E. Schulman

[1] https://fishshell.com/docs/current/relnotes.html
[2] https://fishshell.com/docs/current/index.html

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


fish 3.6.1-1

2023-04-05 Thread Andrew Schulman via Cygwin-announce
fish 3.6.1-1 is now available in Cygwin. This is a new upstream release,
with minor improvements and bug fixes. See the upstream release notes[1] for
a list of changes.

Also in this release, the fish documentation has been moved into a separate
package, fish-doc. The same documentation is available online at the fish
site[2].

fish is the friendly interactive shell. It's a Unix shell that focuses on
interactive use, discoverability, and user friendliness. The design goal of
fish is to give the user a rich set of powerful features in a way that is
easy to discover, remember, and use.

Home page: https://fishshell.com

Andrew E. Schulman

[1] https://fishshell.com/docs/current/relnotes.html
[2] https://fishshell.com/docs/current/index.html