Re: ExitProcess does not work in Cygwin?

2022-01-13 Thread Brian Inglis
On 2022-01-13 16:15, Jay K wrote: On Thursday, January 13, 2022 5:19 PM, Brian Inglis wrote: On 2022-01-13 10:07, Kaz Kylheku wrote: On 2022-01-13 05:40, Eliot Moss wrote: On 1/13/2022 1:39 AM, Jay K wrote: ExitProcess does not work in Cygwin? Just use POSIX exit(3)! I did switch my

Re: python-numpy (1.22.0-1) can't be imported

2022-01-13 Thread airplanemath via Cygwin
On Wed, Jan 12 2022, Marco Atzeri wrote: > On 12.01.2022 12:47, ggl329 wrote: >> Hi Marco, >> I upgraded python39-numpy to 1.22.0-1, and failed to import numpy. >> It seems that mtrand.cpython-39-x86_64-cygwin.dll does not have >> PyInit_mtrand. >> Could you check if numpy can be imported in your

Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6

2022-01-13 Thread Takashi Yano
On Thu, 13 Jan 2022 16:11:04 -0800 Mark Geisert wrote: > Takashi Yano wrote: > > On Wed, 12 Jan 2022 07:41:41 +0100 > > Marco Atzeri wrote: > >> On 12.01.2022 07:27, Jay K wrote: > >>> Ok, here is a small demonstration of the problem. > >>> > >>> #include > >>> #include > >>> #include > >>> >

Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6

2022-01-13 Thread Mark Geisert
Takashi Yano wrote: On Wed, 12 Jan 2022 07:41:41 +0100 Marco Atzeri wrote: On 12.01.2022 07:27, Jay K wrote: Ok, here is a small demonstration of the problem. #include #include #include unsigned __stdcall thread(void* p) { unsigned i; for (i = 0; i < 100; ++i)

Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6

2022-01-13 Thread Takashi Yano
On Wed, 12 Jan 2022 07:41:41 +0100 Marco Atzeri wrote: > On 12.01.2022 07:27, Jay K wrote: > > Ok, here is a small demonstration of the problem. > > > > #include > > #include > > #include > > > > unsigned __stdcall thread(void* p) > > { > >unsigned i; > >for (i = 0; i < 100; ++i) > >

Re: ExitProcess does not work in Cygwin?

2022-01-13 Thread Jay K
> Just use POSIX exit(3)! I did switch my code: #ifdef __CYGWIN__ exit(x); #else ExitProcess(x); #endif . I think the problem is actually in how "Cygwin bash" aka Cygwin, computes the exit code in exec/spawn/system. I.e. it recognizes it is running a Cygwin exe or a native exe and does

Help with standalone samba SID-uid mapping

2022-01-13 Thread Chris Roehrig
I'm trying to set up samba (standalone) following these instructions: https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-samba but I'm having no luck getting my samba user/groups to appear correctly using the comment field as described in the document. I'm using samba 4.13.14 on

Re: -Wsign-conversion flag in gcc in cygwin.

2022-01-13 Thread Csaba Raduly
On Thu, 13 Jan 2022 at 15:34, Amit wrote: > > Hi, > > When I compile "long x = strlen("abcde")" on a linux system with the > following gcc flags -Wall -Wconversion, I get the following warning: ... > warning: conversion to ‘long int’ from ‘size_t’ may change the sign of the > result

Re: renaming with mv over existing file leaves .cyg000000xyz files behind

2022-01-13 Thread Marco Atzeri
On 13.01.2022 17:53, Ronald Hoogenboom wrote: Hi, Renaming with mv over existing file leaves .cyg00xyz files behind I have noticed this when renaming on a smb mounted directory (AKA network drive). cygwin version: 3.2.0(0.340/5/3) windows version: Server 2012 R2 mv version: (GNU coreutils)

character device canonical mode

2022-01-13 Thread Norton Allen
Apparently Cygwin does not support canonical mode on serial devices. On input canonical mode will wait for a newline before returning from a read(). The bit is cleared/ignored by tcsetattr() as demonstrated by a subsequent tcgetattr() in the test program below. I am wondering if this is

Re: ExitProcess does not work in Cygwin?

2022-01-13 Thread Brian Inglis
On 2022-01-13 10:07, Kaz Kylheku (Cygwin) wrote: On 2022-01-13 05:40, Eliot Moss wrote: On 1/13/2022 1:39 AM, Jay K wrote: ExitProcess does not work in Cygwin? Just use POSIX exit(3)! ExitProcess does not appear to be a POSIX function. This is a real issue worth looking into. Though

Re: ExitProcess does not work in Cygwin?

2022-01-13 Thread Kaz Kylheku (Cygwin)
On 2022-01-13 05:40, Eliot Moss wrote: On 1/13/2022 1:39 AM, Jay K wrote: ExitProcess does not work in Cygwin? ExitProcess does not appear to be a POSIX function. This is a real issue worth looking into. Though ExitProcess isn't a POSIX function, Cygwin can capture the termination status

renaming with mv over existing file leaves .cyg000000xyz files behind

2022-01-13 Thread Ronald Hoogenboom
Hi, Renaming with mv over existing file leaves .cyg00xyz files behind I have noticed this when renaming on a smb mounted directory (AKA network drive). cygwin version: 3.2.0(0.340/5/3) windows version: Server 2012 R2 mv version: (GNU coreutils) 8.26-2 samba server version: 3.0.33 (RHEL5)

[PATCH setup] Show a MessageBox warning if running on a deprecated Windows version

2022-01-13 Thread Jon Turney
Show a MessageBox warning if we are running on a Windows version which we have deprecated Cygwin support for: - Windows 6.0 (Windows Vista, Windows Server 2008) - 32-bit Windows This warning can be disabled with '--allow-unsupported-windows'. --- Notes: Not sure if this is needed, or maybe

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2022-01-13 Thread Ken Brown
On 1/13/2022 5:56 AM, Takashi Yano wrote: Ken Brown wrote: 2. You can use the ReturnLength parameter of NtQueryInformationProcess to see how big a buffer is needed. This might be more efficient than repeatedly doubling the buffer size. Even if ReturnLength is used, the first

-Wsign-conversion flag in gcc in cygwin.

2022-01-13 Thread Amit
Hi, When I compile "long x = strlen("abcde")" on a linux system with the following gcc flags -Wall -Wconversion, I get the following warning: == size.c: In function ‘main’: size.c:7:17: warning: conversion to ‘long int’ from ‘size_t’ may change the sign of the result

Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6

2022-01-13 Thread Eliot Moss
On 1/13/2022 1:40 AM, Jay K wrote: I don't know why I didn't get the reply in email, but this is representative of the real world code.  - Jay From: Jay K Sent: Wednesday, January 12, 2022 6:27 AM To: cyg...@sourceware.org Subject: Re: proc_waiter: error on read of child wait pipe 0x0,

Re: ExitProcess does not work in Cygwin?

2022-01-13 Thread Eliot Moss
On 1/13/2022 1:39 AM, Jay K wrote: ExitProcess does not work in Cygwin? $ rm *.exe # u is for Unix # w is for Windows $ cat u.c #include int main() { exit(1); } $ gcc u.c $ ./a.exe $ echo $? 1 => as expected $ cat w.c #include int main() { ExitProcess(1); } $ gcc w.c $ ./a.exe

[PATCH 3/4] Cygwin: pty: Stop closing and recreating attach_mutex.

2022-01-13 Thread Takashi Yano
- Closing attach_mutex and recreating it causes the race issue between pty and console codes. With this patch, attach_mutex is created only once in a process which opens pty, and never closed in order to avoid this issue. Addresses:

[PATCH 4/4] Cygwin: console: Fix potential deadlock regarding acuqiring mutex.

2022-01-13 Thread Takashi Yano
- Acquiring input_mutex and attach_mutex in console code has potential risk of deadlock. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/select.cc | 7 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler.h

[PATCH 1/4] Cygwin: pty, console: Fix deadlock in GDB regarding mutex.

2022-01-13 Thread Takashi Yano
- GDB inferior may be suspended while the inferior grabs mutex. This causes deadlock in terminal I/O. With this patch, timeout for waiting mutex is set to 0 for the debugger process when the process calls CreateProcess() with DEBUG_PROCESS flag to avoid deadlock. This may cause the race

[PATCH 0/4] Some fixes for console and pty.

2022-01-13 Thread Takashi Yano
Takashi Yano (4): Cygwin: pty, console: Fix deadlock in GDB regarding mutex. Cygwin: pty: Fix memory leak in master_fwd_thread. Cygwin: pty: Stop closing and recreating attach_mutex. Cygwin: console: Fix potential deadlock regarding acuqiring mutex. winsup/cygwin/fhandler.h | 5

[PATCH 2/4] Cygwin: pty: Fix memory leak in master_fwd_thread.

2022-01-13 Thread Takashi Yano
- If master_fwd_thread is terminated by cygthread::terminate_thread(), the opportunity to release tmp_pathbuf is missed, resulting in a memory leak. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 6 +- winsup/cygwin/tty.cc | 1 + winsup/cygwin/tty.h | 1

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2022-01-13 Thread Takashi Yano
I am sorry for being absent for a long time. On Sun, 26 Dec 2021 10:09:57 -0500 Ken Brown wrote: > On 12/25/2021 11:56 PM, Jeremy Drake wrote: > > I set up a windows server 2022 VM last night and went nuts stressing > > pacman/GPGME. I was able to reproduce the issue there: > > > > status =

add the ssh key in cygwin-developers

2022-01-13 Thread Hemanath Goud
I would like to include my ssh key in the git repository. My ssh key is BEGIN SSH2 PUBLIC KEY ssh-rsa