Re: /usr/bin/fallocate missing in Cygwin 3.5's "util-linux" ...

2024-01-23 Thread Cedric Blancher via Cygwin
On Tue, 23 Jan 2024 at 12:37, Roland Mainz via Cygwin  wrote:
>
> Hi!
>
> -
>
> Small bug report:
> Cygwin 3.5. now has support for SEEK_HOLE (thanks! :-) ), but
> /usr/bin/fallocate is still missing in the "util-linux" package.
>
> Can someone please enable that tool ?

Good catch!

@Corinna Vinschen
Does /usr/bin/cp in Cygwin copy holes correctly?

Ced
-- 
Cedric Blancher 
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

-- 
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: Wrong NTFS permissions

2024-01-23 Thread Marco Atzeri via Cygwin

On 23/01/2024 22:54, Vincent Rivière via Cygwin wrote:

Hi,

I'm facing a really weird issue with NTFS permissions.

$ umask
0022

$ cd /cygdrive/h/


what is H ?


$ mkdir a

$ ls -ld a
drwxr-xr-x 1 vincent vincent 0 Jan 23 22:35 a

# You can see that permissions are fine.

$ getfacl a
# file: a
# owner: vincent
# group: vincent
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:other::rwx

# I have no idea if those default: values are good.

$ cd a
$ mkdir b

$ ls -ld b
drwxr-xrwx+ 1 vincent vincent 0 Jan 23 22:44 b

# Bogus permissions!

$ getfacl b
# file: b
# owner: vincent
# group: vincent
getfacl: b: Invalid argument

Am I missing something, or this is a Cygwin bug?

Cheers,


my guess,
it is related to the remote server as I see as expected

$ cd /cygdrive/z

$ mkdir a

$ getfacl a
# file: a
# owner: Unknown+User
# group: Unix_Group+0
user::rwx
group::rwx
other::rwx

$ cd a

$ mkdir b

$ getfacl b
# file: b
# owner: Unknown+User
# group: Unix_Group+0
user::rwx
group::rwx
other::rwx


Use csih package for more info on your remote package

$ /usr/lib/csih/getVolInfo .
Device Type: 0x07
Characteristics: 0x0010
  FILE_REMOVABLE_MEDIA  : FALSE
  FILE_REMOTE_DEVICE: TRUE
Volume Name: 
Serial Number  : 2870488680
Max Filenamelength : 255
Filesystemname : 
Flags  : 0x0001002f
  FILE_CASE_SENSITIVE_SEARCH: TRUE
  FILE_CASE_PRESERVED_NAMES : TRUE
  FILE_UNICODE_ON_DISK  : TRUE
  FILE_PERSISTENT_ACLS  : TRUE
  FILE_FILE_COMPRESSION : FALSE
  FILE_VOLUME_QUOTAS: TRUE
  FILE_SUPPORTS_SPARSE_FILES: FALSE
  FILE_SUPPORTS_REPARSE_POINTS  : FALSE
  FILE_SUPPORTS_REMOTE_STORAGE  : FALSE
  FILE_RETURNS_CLEANUP_RESULT_INFO  : FALSE
  FILE_SUPPORTS_POSIX_UNLINK_RENAME : FALSE
  FILE_VOLUME_IS_COMPRESSED : FALSE
  FILE_SUPPORTS_OBJECT_IDS  : TRUE
  FILE_SUPPORTS_ENCRYPTION  : FALSE
  FILE_NAMED_STREAMS: FALSE
  FILE_READ_ONLY_VOLUME : FALSE
  FILE_SEQUENTIAL_WRITE_ONCE: FALSE
  FILE_SUPPORTS_TRANSACTIONS: FALSE
  FILE_SUPPORTS_HARD_LINKS  : FALSE
  FILE_SUPPORTS_EXTENDED_ATTRIBUTES : FALSE
  FILE_SUPPORTS_OPEN_BY_FILE_ID : FALSE
  FILE_SUPPORTS_USN_JOURNAL : FALSE
  FILE_SUPPORTS_INTEGRITY_STREAMS   : FALSE
  FILE_SUPPORTS_BLOCK_REFCOUNTING   : FALSE
  FILE_SUPPORTS_SPARSE_VDL  : FALSE
  FILE_DAX_VOLUME   : FALSE
  FILE_SUPPORTS_GHOSTING: FALSE


Regards
Marco


--
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: /usr/bin/fallocate missing in Cygwin 3.5's "util-linux" ...

2024-01-23 Thread Mark Geisert via Cygwin

On 1/23/2024 3:36 AM, Roland Mainz via Cygwin wrote:

Small bug report:
Cygwin 3.5. now has support for SEEK_HOLE (thanks! :-) ), but
/usr/bin/fallocate is still missing in the "util-linux" package.

Can someone please enable that tool ?


I'll look into this.

..mark


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


Wrong NTFS permissions

2024-01-23 Thread Vincent Rivière via Cygwin

Hi,

I'm facing a really weird issue with NTFS permissions.

$ umask
0022

$ cd /cygdrive/h/
$ mkdir a

$ ls -ld a
drwxr-xr-x 1 vincent vincent 0 Jan 23 22:35 a

# You can see that permissions are fine.

$ getfacl a
# file: a
# owner: vincent
# group: vincent
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:other::rwx

# I have no idea if those default: values are good.

$ cd a
$ mkdir b

$ ls -ld b
drwxr-xrwx+ 1 vincent vincent 0 Jan 23 22:44 b

# Bogus permissions!

$ getfacl b
# file: b
# owner: vincent
# group: vincent
getfacl: b: Invalid argument

Am I missing something, or this is a Cygwin bug?

Cheers,

--
Vincent Rivière

--
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: [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump

2024-01-23 Thread Corinna Vinschen
On Jan 23 14:20, Jon Turney wrote:
> On 12/01/2024 14:09, Jon Turney wrote:
> > Pre-format a command to be executed on a fatal error to run 'dumper'
> > (using an absolute path).
> > 
> > Factor out executing a pre-formatted command, so we can use that for
> > invoking the JIT debugger in try_to_debug() (if error_start is present
> > in the CYGWIN env var) and to invoke dumper when a fatal error occurs.
> > 
> 
> So, there is a small problem with this change: because dumper itself
> terminates the dumped process, it doesn't go on to exit with the signal+128
> exit status.
> 
> (In fact, it seems to exit with status 0 when terminated by an attached
> debugger terminating, which isn't great)
> 
> That's relatively easy to fix: just use the '-n' option to dumper so it
> detaches before exiting, to prevent that terminating the dumped process, but
> then we run into the difficulties of reliably detecting that dumper has
> attached and done it's work, so it's safe for us to exit.
> 
> Attached patch does that, and documents the expectations on the error_start
> command a bit more clearly.

Please push.

> Even then this is clearly not totally bullet-proof. Maybe the right thing to
> do is add a suitable timeout here, so even if we fail to notice the
> DebugActiveProcess() (or there's a custom JIT debugger which just writes the
> fact a process crashed to a logfile or something), we'll exit eventually?

Timeouts are just that tiny little bit more bullet-proof, they still
aren't totally bullet-proof.

What timeout were you thinking of?  milliseconds?


Corinna


Re: [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump

2024-01-23 Thread Jon Turney

On 12/01/2024 14:09, Jon Turney wrote:

Pre-format a command to be executed on a fatal error to run 'dumper'
(using an absolute path).

Factor out executing a pre-formatted command, so we can use that for
invoking the JIT debugger in try_to_debug() (if error_start is present
in the CYGWIN env var) and to invoke dumper when a fatal error occurs.



So, there is a small problem with this change: because dumper itself 
terminates the dumped process, it doesn't go on to exit with the 
signal+128 exit status.


(In fact, it seems to exit with status 0 when terminated by an attached 
debugger terminating, which isn't great)


That's relatively easy to fix: just use the '-n' option to dumper so it 
detaches before exiting, to prevent that terminating the dumped process, 
but then we run into the difficulties of reliably detecting that dumper 
has attached and done it's work, so it's safe for us to exit.


Attached patch does that, and documents the expectations on the 
error_start command a bit more clearly.


Even then this is clearly not totally bullet-proof. Maybe the right 
thing to do is add a suitable timeout here, so even if we fail to notice 
the DebugActiveProcess() (or there's a custom JIT debugger which just 
writes the fact a process crashed to a logfile or something), we'll exit 
eventually?
From 85120a1697294cd93ff68f6b1840145251ce4185 Mon Sep 17 00:00:00 2001
From: Jon Turney 
Date: Tue, 16 Jan 2024 16:12:51 +
Subject: [PATCH] Cygwin: Don't terminate via dumper

A process which is exiting due to a core dumping signal doesn't
propagate the correct exist status after dumping core, because 'dumper'
itself forcibly terminates the process.

Use 'dumper -n' to avoid killing the dumped process, so we continue to
the end of signal_exit() , to exit with the 128+signal exit status.

Busy-wait in exec_prepared_command() in an attempt to reliably notice
the dumper attaching, so we don't get stuck there.

Also: document these important facts for custom uses of error_start.
---
 winsup/cygwin/exceptions.cc | 7 +++
 winsup/doc/cygwinenv.xml| 6 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 8b1c5493e..0e1a804ca 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -149,7 +149,7 @@ dumper_init (void)
 
   /* Calculate the length of the command, allowing for an appended DWORD PID 
and
  terminating null */
-  int cmd_len = 1 + wcslen(dll_dir) + 11 + 2 + 1 + wcslen(global_progname) + 1 
+ 10 + 1;
+  int cmd_len = 1 + wcslen(dll_dir) + 11 + 5 + 1 + wcslen(global_progname) + 1 
+ 10 + 1;
   if (cmd_len > 32767)
 {
   /* If this comes to more than the 32,767 characters CreateProcess() can
@@ -163,7 +163,7 @@ dumper_init (void)
   cp = wcpcpy (cp, L"\"");
   cp = wcpcpy (cp, dll_dir);
   cp = wcpcpy (cp, L"\\dumper.exe");
-  cp = wcpcpy (cp, L"\" ");
+  cp = wcpcpy (cp, L"\" -n ");
   cp = wcpcpy (cp, L"\"");
   cp = wcpcpy (cp, global_progname);
   wcscat (cp, L"\"");
@@ -570,9 +570,8 @@ int exec_prepared_command (PWCHAR command)
 system_printf ("Failed to start, %E");
   else
 {
-  SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
   while (!being_debugged ())
-   Sleep (1);
+   Sleep (0);
   Sleep (2000);
 }
 
diff --git a/winsup/doc/cygwinenv.xml b/winsup/doc/cygwinenv.xml
index d97f2b77d..05672c404 100644
--- a/winsup/doc/cygwinenv.xml
+++ b/winsup/doc/cygwinenv.xml
@@ -46,6 +46,12 @@ to the command as arguments.
   Note: This has no effect if a debugger is already attached when the fatal
   error occurs.
 
+
+  Note: The command invoked must either (i) attach to the errored process with
+  DebugActiveProcess(), or (ii) forcibly terminate the
+  errored process (with TerminateProcess() or similar), as
+  otherwise the errored process will wait forever for a debugger to attach.
+
 
 
 
-- 
2.43.0



bash 5.2.21-1

2024-01-23 Thread Corinna Vinschen via Cygwin-announce
The following packages have been uploaded to the Cygwin distribution:

* bash-5.2.21-1
* bash-devel-5.2.21-1


-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



/usr/bin/fallocate missing in Cygwin 3.5's "util-linux" ...

2024-01-23 Thread Roland Mainz via Cygwin
Hi!

-

Small bug report:
Cygwin 3.5. now has support for SEEK_HOLE (thanks! :-) ), but
/usr/bin/fallocate is still missing in the "util-linux" package.

Can someone please enable that tool ?



Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&& programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

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


Updated: weechat-4.2.1-1

2024-01-23 Thread Sébastien Helleu
Version 4.2.1-1 of "weechat" has been uploaded.

ChangeLog:

https://weechat.org/files/doc/weechat/ChangeLog-4.2.1.html

DESCRIPTION
WeeChat is a fast, light and extensible chat client. It runs on many platforms
like Linux, Unix, BSD, GNU Hurd, Mac OS X and Windows (bash/ubuntu and
cygwin).

HOMEPAGE
https://weechat.org/

Sébastien Helleu.
-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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