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

2024-01-27 Thread Jon Turney
On 26/01/2024 11:52, Corinna Vinschen wrote: On Jan 26 12:12, Corinna Vinschen wrote: On Jan 25 20:03, Jon Turney wrote: On 25/01/2024 18:21, Corinna Vinschen wrote: On Jan 25 14:50, Jon Turney wrote: On 24/01/2024 14:39, Corinna Vinschen wrote: On Jan 24 13:28, Jon Turney wrote: On 23/01

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

2024-01-25 Thread Jon Turney
On 25/01/2024 18:21, Corinna Vinschen wrote: On Jan 25 14:50, Jon Turney wrote: On 24/01/2024 14:39, Corinna Vinschen wrote: On Jan 24 13:28, Jon Turney wrote: On 23/01/2024 14:29, Corinna Vinschen wrote: On Jan 23 14:20, Jon Turney wrote: [...] So this situation with a JIT debugger

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

2024-01-25 Thread Jon Turney
On 24/01/2024 14:39, Corinna Vinschen wrote: On Jan 24 13:28, Jon Turney wrote: On 23/01/2024 14:29, Corinna Vinschen wrote: On Jan 23 14:20, Jon Turney wrote: 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

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

2024-01-24 Thread Jon Turney
On 23/01/2024 14:29, Corinna Vinschen wrote: On Jan 23 14:20, Jon Turney wrote: 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

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

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

2024-01-16 Thread Jon Turney
On 15/01/2024 14:28, Corinna Vinschen wrote: On Jan 15 13:27, Jon Turney wrote: On 15/01/2024 09:46, Corinna Vinschen wrote: On Jan 13 14:20, Jon Turney wrote: On 12/01/2024 14:09, Jon Turney wrote: + + PWCHAR cp = dumper_command; + cp = wcpcpy (cp, L"\""); + cp = wcpc

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

2024-01-15 Thread Jon Turney
On 15/01/2024 09:46, Corinna Vinschen wrote: On Jan 13 14:20, Jon Turney wrote: On 12/01/2024 14:09, Jon Turney wrote: + + PWCHAR cp = dumper_command; + cp = wcpcpy (cp, L"\""); + cp = wcpcpy (cp, dll_dir); + cp = wcpcpy (cp, L"\\dumper.exe"); + cp = wcpcpy (cp

Re: [PATCH] Cygwin: introduce close_range

2024-01-14 Thread Jon Turney
On 14/01/2024 16:07, Christian Franke wrote: Recently I learned about the existence and usefulness of close_range(): https://github.com/smartmontools/smartmontools/issues/235 https://man.freebsd.org/cgi/man.cgi?query=close_range=2 https://man7.org/linux/man-pages/man2/close_range.2.html Note

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

2024-01-13 Thread Jon Turney
On 12/01/2024 14:09, Jon Turney wrote: + + PWCHAR cp = dumper_command; + cp = wcpcpy (cp, L"\""); + cp = wcpcpy (cp, dll_dir); + cp = wcpcpy (cp, L"\\dumper.exe"); + cp = wcpcpy (cp, L"\" "); + cp = wcpcpy (cp, L"\""); + cp =

Re: [PATCH 5/5] Cygwin: Update documentation for cygwin_stackdump

2024-01-13 Thread Jon Turney
On 12/01/2024 18:44, Corinna Vinschen wrote: On Jan 12 14:09, Jon Turney wrote: --- winsup/doc/misc-funcs.xml | 4 1 file changed, 4 insertions(+) diff --git a/winsup/doc/misc-funcs.xml b/winsup/doc/misc-funcs.xml index 7463942e6..55c5cac94 100644 --- a/winsup/doc/misc-funcs.xml +++ b

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

2024-01-12 Thread Jon Turney
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

[PATCH 5/5] Cygwin: Update documentation for cygwin_stackdump

2024-01-12 Thread Jon Turney
--- winsup/doc/misc-funcs.xml | 4 1 file changed, 4 insertions(+) diff --git a/winsup/doc/misc-funcs.xml b/winsup/doc/misc-funcs.xml index 7463942e6..55c5cac94 100644 --- a/winsup/doc/misc-funcs.xml +++ b/winsup/doc/misc-funcs.xml @@ -106,6 +106,10 @@ enum. The second is an optional

[PATCH 4/5] Cygwin: Treat api_fatal() similarly to a core-dumping signal

2024-01-12 Thread Jon Turney
Provide the same debugging opportunities for api_fatal() as we do for a core-dumping signal: 1) Break into any attached debugger 2) Start JIT debugger (if configured) (keeping these under DEBUGGING doesn't seem helpful) 3) Write a coredump (if rlim_core > 1MB) 4) Write a stackdump (if that

[PATCH 3/5] Cygwin: Define and use __WCOREFLAG

2024-01-12 Thread Jon Turney
Also fix a typo in description of exit status --- winsup/cygwin/exceptions.cc | 2 +- winsup/cygwin/include/cygwin/wait.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 6bd34392a..05ffdc27e 100644

[PATCH 2/5] Cygwin: Disable writing core dumps by default.

2024-01-12 Thread Jon Turney
Change the default core limit from unlimited to 0 (disabled) --- winsup/cygwin/mm/cygheap.cc | 2 +- winsup/cygwin/release/3.5.0 | 3 +++ winsup/doc/new-features.xml | 6 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/mm/cygheap.cc

[PATCH 0/5] Coredump under 'ulimit -c' control (v2)

2024-01-12 Thread Jon Turney
r pid 1398, tid 7136 $ gdb segv-program.exe segv-program.exe.core [...] Jon Turney (5): Cygwin: Make 'ulimit -c' control writing a coredump Cygwin: Disable writing core dumps by default. Cygwin: Define and use __WCOREFLAG Cygwin: Treat api_fatal() similarly to a core-dumping sig

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

2024-01-12 Thread Jon Turney
On 11/01/2024 09:42, Corinna Vinschen wrote: On Jan 10 17:38, Jon Turney wrote: On 10/01/2024 15:30, Corinna Vinschen wrote: On Jan 10 13:57, Jon Turney wrote: [...] Also: Fix the (deprecated) cygwin_dumpstack() function so it will now write a .stackdump file, even when ulimit -c is zero

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

2024-01-10 Thread Jon Turney
On 10/01/2024 15:30, Corinna Vinschen wrote: On Jan 10 13:57, Jon Turney wrote: [...] Also: Fix the (deprecated) cygwin_dumpstack() function so it will now write a .stackdump file, even when ulimit -c is zero. (Note that cygwin_dumpstack() is still idempotent, which is perhaps odd) Given

[PATCH] Cygwin: Fix a stray '\n' in cygcheck manpage

2024-01-10 Thread Jon Turney
--- winsup/doc/utils.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index 8261e7ebd..692dae38f 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -210,7 +210,7 @@ At least one command option or a PROGRAM is

[PATCH 2/2] Cygwin: Disable writing core dumps by default.

2024-01-10 Thread Jon Turney
Change the default core limit from unlimited to 0 (disabled) --- winsup/cygwin/mm/cygheap.cc | 2 +- winsup/doc/new-features.xml | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/mm/cygheap.cc b/winsup/cygwin/mm/cygheap.cc index a20ee5972..3dc0c011f 100644

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

2024-01-10 Thread Jon Turney
Factor out pre-formatting a command to be executed on a fatal signal, and use that for both error_start (if present in the CYGWIN env var) and for 'dumper'. Factor out executing that command, so we can use it from try_to_debug() and when a fatal signal occurs. On a fatal signal, invoke dumper to

[PATCH 0/2] Write a coredump under 'ulimit -c' control

2024-01-10 Thread Jon Turney
The idea here is to make debugging using a coredump work as usual on a unix, e.g.: $ ulimit -c unlimited $ ./segv-program *** starting 'dumper "C:/cygwin64/work/segv-program.exe" 3712' for pid 546, tid 10640 $ gdb segv-program.exe segv-program.exe.core [...] Jon Turney (2): Cy

Re: [PATCH] Cygwin: Add '--names-only' flag to cygcheck

2023-11-29 Thread Jon Turney
On 24/11/2023 18:31, Corinna Vinschen wrote: On Nov 24 17:06, Jon Turney wrote: Add '--names-only' flag to cygcheck, to output just the bare package names. Push it! I added changes to the manpage to document this option as well, before pushing it. Thanks.

[PATCH] Cygwin: Add '--names-only' flag to cygcheck

2023-11-24 Thread Jon Turney
Add '--names-only' flag to cygcheck, to output just the bare package names. --- Notes: Rather than more hacky aftermarket solutions, let's make cygcheck output something more useful for feeding into setup. Next step would be to adjust setup's argument parsing so 'setup -P

Re: [PATCH] Add initial support for SOURCE_DATE_EPOCH

2023-09-10 Thread Jon Turney
On 08/09/2023 15:09, Corinna Vinschen wrote: Jon, you did all the latest work in terms of the build machinery. Would you mind to review this patch, please? Sure. Patch looks all right to me, so I applied it. On Sep 5 19:01, Christian Franke wrote: This patch enables reproducible builds

Re: [PATCH] Cygwin: Fix __cpuset_zero_s prototype

2023-09-10 Thread Jon Turney
On 10/09/2023 00:37, Takashi Yano wrote: Hi Corinna, On Sat, 9 Sep 2023 23:29:22 +0200 Corinna Vinschen wrote: On Sep 7 22:36, Mark Geisert wrote: Add a missing "void" to the prototype for __cpuset_zero_s(). Reported-by: Marco Mason Addresses:

[PATCH] Cygwin: testsuite: Add socketpair_full test

2023-08-08 Thread Jon Turney
Add the socketpair_full test from [1], fixed by [2], slightly improved by the addition of a timeout. This test might perhaps be better named. This might also serve as an example of how to add new tests. [1] https://cygwin.com/pipermail/cygwin-developers/2023-July/012640.html [2] dedbbd74d0a8

[PATCH 2/4] Cygwin: testsuite: Update README

2023-08-04 Thread Jon Turney
v2: Polish instructions on adding a test Signed-off-by: Jon Turney --- winsup/testsuite/README | 82 + 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/winsup/testsuite/README b/winsup/testsuite/README index ff2df4119..511133e4d 100644

[PATCH 3/4] Cygwin: testsuite: Fix cygload test

2023-08-04 Thread Jon Turney
Use cygrun to isolate the cygload test from the current DLL, which allows it to pass. --- winsup/testsuite/cygrun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/testsuite/cygrun.sh b/winsup/testsuite/cygrun.sh index c82c1872b..bf1d5cc6b 100755 ---

[PATCH 4/4] Cygwin: CI: XFAIL umask03

2023-08-04 Thread Jon Turney
umask03 fails in CI due to some not understood weirdness. --- winsup/testsuite/Makefile.am | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/testsuite/Makefile.am b/winsup/testsuite/Makefile.am index 8f2967a6d..228955668 100644 --- a/winsup/testsuite/Makefile.am +++

[PATCH 0/4] Testsuite update

2023-08-04 Thread Jon Turney
This gets us down to no permanent failures in the testsuite in CI. When run locally, msgtest, semtest and shmtest fail because they need a running cygserver using the test DLL, and I haven't got a good idea about how to automate that. devdsp fails due to a hang in child while exiting. Jon

[PATCH 1/4] Cygwin: testsuite: Add '-notimeout' option to cygrun

2023-08-04 Thread Jon Turney
Add '-notimeout' option for cygrun. This is very useful when using it to run a test standalone and under a debugger. Also: warn about excess arguments --- winsup/testsuite/cygrun.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git

[PATCH] Cygwin: testsuite: Drop using DejaGnu to run tests

2023-07-21 Thread Jon Turney
-off-by: Jon Turney --- .github/workflows/cygwin.yml | 2 +- winsup/configure.ac| 2 +- winsup/doc/faq-programming.xml | 5 +- winsup/testsuite/Makefile.am | 27 winsup/testsuite/README| 22

Re: [PATCH 0/2] Testsuite adjustment and relevant fix

2023-07-21 Thread Jon Turney
On 20/07/2023 16:14, Corinna Vinschen wrote: On Jul 20 13:55, Jon Turney wrote: On 19/07/2023 16:33, Corinna Vinschen wrote: On Jul 19 13:41, Jon Turney wrote: [1/2] has the side effect of flipping test stat06 from working to failing. [2/2] fixes that When run with TDIRECTORY set, libltp

Re: [PATCH 0/2] Testsuite adjustment and relevant fix

2023-07-20 Thread Jon Turney
On 19/07/2023 16:33, Corinna Vinschen wrote: On Jul 19 13:41, Jon Turney wrote: [1/2] has the side effect of flipping test stat06 from working to failing. [2/2] fixes that When run with TDIRECTORY set, libltp just uses that directory and assumes something else will clean it up. When

[PATCH 2/2] Cygwin: Fix Windows file handle leak in stat("file", -1)

2023-07-19 Thread Jon Turney
fh_pc with invalid pc.") Signed-off-by: Jon Turney --- winsup/cygwin/syscalls.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 73343ecc1..c6999407e 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/s

[PATCH 0/2] Testsuite adjustment and relevant fix

2023-07-19 Thread Jon Turney
he STATUS_DELETE_PENDING state until the Windows handle which stat_worker() leaks when an exception occurs is closed (when the processes exits). Future work: It looks like similar problems might generically occur in similar code througout syscalls.cc. Jon Turney (2): Cygwin: testsuite: Drop se

[PATCH 1/2] Cygwin: testsuite: Drop setting TDIRECTORY

2023-07-19 Thread Jon Turney
Drop setting TDIRECTORY, just use /tmp in the 'test installation' now that we have it. This effectively reverts f3ed5f2fe029d74372aca68b18936e164ff47cf7 Signed-off-by: Jon Turney --- winsup/testsuite/Makefile.am | 8 winsup/testsuite/cygrun.c | 5 + winsup

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-18 Thread Jon Turney
On 18/07/2023 13:09, Corinna Vinschen wrote: On Jul 18 12:20, Jon Turney wrote: On 17/07/2023 16:41, Corinna Vinschen wrote: Looking into pthread::cancel we have this order of things: // cancel deferred mutex.unlock (); canceled = true; SetEvent (cancel_event

Re: [PATCH 00/11] More testsuite fixes

2023-07-18 Thread Jon Turney
18ddda696137106eaa397a01bc06fc97c59df02d Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 16 Jul 2023 14:46:00 +0100 Subject: [PATCH] Cygwin: Restore signal handlers on thread cancellation during system() Add back the restoration of signal handlers modified during system() on thread cancellation

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-18 Thread Jon Turney
On 17/07/2023 16:41, Corinna Vinschen wrote: On Jul 17 16:21, Corinna Vinschen wrote: On Jul 17 12:51, Jon Turney wrote: On 17/07/2023 12:05, Corinna Vinschen wrote: diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index f614e01c42f6..fceb9bda1806 100644 --- a/winsup/cygwin

Re: [PATCH 00/11] More testsuite fixes

2023-07-17 Thread Jon Turney
On 13/07/2023 12:38, Jon Turney wrote: cancel11: some funkiness I can't work out, causing the save/restoring signal handlers around system() to not work correctly So, the test here: is the SIGINT handle restored correctly if the thread executing system() is cancelled. This test fails

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-17 Thread Jon Turney
On 17/07/2023 12:05, Corinna Vinschen wrote: On Jul 14 20:57, Corinna Vinschen wrote: On Jul 14 14:04, Jon Turney wrote: On 13/07/2023 19:53, Corinna Vinschen wrote: Nevertheless, I think this is ok to do. The description of pthread_cancel contains this: Asynchronous cancelability means

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-17 Thread Jon Turney
On 14/07/2023 14:04, Jon Turney wrote: On 13/07/2023 19:53, Corinna Vinschen wrote: normally after 10 seconds. (See the commentary in pthread::cancel() in thread.cc, where it checks if the target thread is inside the kernel, and silently converts the cancellation into a deferred one

Re: [PATCH 09/11] Cygwin: testsuite: Fix a buffer overflow in symlink01

2023-07-14 Thread Jon Turney
On 13/07/2023 19:17, Corinna Vinschen wrote: On Jul 13 12:39, Jon Turney wrote: See ltp commit 44d51c3f Can you please add some text which helps the reader to understand the issue without having to refer to the ltp repo? Sure, I added that.

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-14 Thread Jon Turney
On 13/07/2023 19:53, Corinna Vinschen wrote: On Jul 13 20:37, Corinna Vinschen wrote: On Jul 13 20:16, Corinna Vinschen wrote: On Jul 13 12:39, Jon Turney wrote: These tests async thread cancellation of a thread that doesn't have any cancellation points. Unfortunately, since 450f557f

Re: [PATCH] Cygwin: pthread: Take note of schedparam in pthread_create

2023-07-14 Thread Jon Turney
On 13/07/2023 19:00, Corinna Vinschen wrote: On Jul 13 14:14, Jon Turney wrote: Take note of schedparam in any pthread_attr_t passed to pthread_create. postcreate() (racily, after the thread is actually created), sets the scheduling priority if it's inherited, but precreate() doesn't store any

[PATCH] Cygwin: pthread: Take note of schedparam in pthread_create

2023-07-13 Thread Jon Turney
Take note of schedparam in any pthread_attr_t passed to pthread_create. postcreate() (racily, after the thread is actually created), sets the scheduling priority if it's inherited, but precreate() doesn't store any scheduling priority explicitly set via a non-default attr to create, so

Re: [PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-13 Thread Jon Turney
On 13/07/2023 12:39, Jon Turney wrote: These tests async thread cancellation of a thread that doesn't have any cancellation points. Unfortunately, since 450f557f the async cancellation silently fails when the thread is inside the kernel function Sleep(), so it just exits normally after 10

[PATCH 11/11] Cygwin: testsuite: Drop Adminstrator privileges while running tests

2023-07-13 Thread Jon Turney
Test access05 and symlink03 expect operations to fail which succeed when we have Adminstrator privileges. There's perhaps a bit of incoherency here: some XFAILed tests expect to run as root (so maybe we need the ability to selectively cygdrop?). --- .github/workflows/cygwin.yml | 1 +

[PATCH 10/11] Cygwin: testsuite: Minor fixes to umask03

2023-07-13 Thread Jon Turney
See ltp commits f32691e7, 923b23ff and b846e7bb --- winsup/testsuite/winsup.api/ltp/umask03.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/winsup/testsuite/winsup.api/ltp/umask03.c b/winsup/testsuite/winsup.api/ltp/umask03.c index

[PATCH 09/11] Cygwin: testsuite: Fix a buffer overflow in symlink01

2023-07-13 Thread Jon Turney
See ltp commit 44d51c3f --- winsup/testsuite/winsup.api/ltp/symlink01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/testsuite/winsup.api/ltp/symlink01.c b/winsup/testsuite/winsup.api/ltp/symlink01.c index 54a24b87f..186a85b4e 100644 ---

[PATCH 06/11] Cygwin: testsuite: Also check direct call in systemcall

2023-07-13 Thread Jon Turney
Check direct call to system(), as well as one in a subprocess. (This is a lot easier to debug when it's completely broken by the environment the test is running in) --- winsup/testsuite/winsup.api/systemcall.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH 08/11] Cygwin: testsuite: Busy-wait in cancel3 and cancel5

2023-07-13 Thread Jon Turney
These tests async thread cancellation of a thread that doesn't have any cancellation points. Unfortunately, since 450f557f the async cancellation silently fails when the thread is inside the kernel function Sleep(), so it just exits normally after 10 seconds. (See the commentary in

[PATCH 07/11] Cygwin: testsuite: Fix for limited thread priority values

2023-07-13 Thread Jon Turney
Since commit 4b51e4c1, we return the actual thread priority, not what we originally stored in the thread attributes. Windows only supports 7 thread priority levels, which we map onto the 32 required by POSIX. So, only a subset of values will be returned exactly by by pthread_getschedparam()

[PATCH 05/11] Cygwin: testsuite: Just log result of second open of /dev/dsp

2023-07-13 Thread Jon Turney
Do not rate successful second open of /dev/dsp as an error, just log the result. Based on this patch by Gerd Spalink: https://cygwin.com/pipermail/cygwin-patches/2004q3/004848.html --- winsup/testsuite/winsup.api/devdsp.c | 20 ++-- 1 file changed, 6 insertions(+), 14

[PATCH 04/11] Cygwin: testsuite: Skip devdsp test when no audio devices present

2023-07-13 Thread Jon Turney
--- winsup/testsuite/Makefile.am | 3 +++ winsup/testsuite/winsup.api/devdsp.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/winsup/testsuite/Makefile.am b/winsup/testsuite/Makefile.am index 11332eda2..60111a0aa 100644 --- a/winsup/testsuite/Makefile.am +++

[PATCH 03/11] Cygwin: testsuite: Remove const from writable string in fcntl07b

2023-07-13 Thread Jon Turney
--- winsup/testsuite/winsup.api/ltp/fcntl07B.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/testsuite/winsup.api/ltp/fcntl07B.c b/winsup/testsuite/winsup.api/ltp/fcntl07B.c index 4e94ff267..db866fddd 100644 --- a/winsup/testsuite/winsup.api/ltp/fcntl07B.c +++

[PATCH 02/11] Cygwin: testsuite: Add a simple timeout mechanism

2023-07-13 Thread Jon Turney
Astonishingly, we don't have this already, so tests which hang just stop the testsuite dead in it's tracks... --- winsup/testsuite/cygrun.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/winsup/testsuite/cygrun.c b/winsup/testsuite/cygrun.c index

[PATCH 01/11] Cygwin: testsuite: Setup test prereqs in 'installation' the tests run in

2023-07-13 Thread Jon Turney
Do some setup in the Cygwin 'installation' at testsuite/testinst/: * Ensure /tmp exists * Use BusyBox to provide executables needed by tests which use system() (sh, sleep, ls) This enables tests which use system(), or require /tmp to exist to pass. --- .github/workflows/cygwin.yml | 3 ++-

[PATCH 00/11] More testsuite fixes

2023-07-13 Thread Jon Turney
. Jon Turney (11): Cygwin: testsuite: Setup test prereqs in 'installation' the tests run in Cygwin: testsuite: Add a simple timeout mechanism Cygwin: testsuite: Remove const from writable string in fcntl07b Cygwin: testsuite: Skip devdsp test when no audio devices present Cygwin

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Jon Turney
On 07/07/2023 10:44, Corinna Vinschen wrote: Hi Mark, On Jul 7 00:41, Mark Geisert wrote: The current version of cannot be compiled by Clang due to the use of __builtin* functions. Their presence here was a dubious optimization anyway, so their usage has been converted to standard library

Re: [PATCH v2] Cygwin: Fix type mismatch on sys/cpuset.h

2023-07-01 Thread Jon Turney
On 14/03/2023 08:56, Mark Geisert wrote: Addresses https://cygwin.com/pipermail/cygwin/2023-March/253220.html Take the opportunity to follow FreeBSD's and Linux's lead in recasting macro inline code as calls to static inline functions. This allows the macros to be type-safe. In addition,

Re: [PATCH] Adjust CWD magic to accommodate for the latest Windows previews

2023-05-24 Thread Jon Turney
On 22/05/2023 12:36, Johannes Schindelin wrote: Reportedly Windows 11 build 25*** from Insider changed the current working directory logic a bit, and Cygwin's "magic" (or: "technologically sufficiently advanced") code needs to be adjusted accordingly. This fixes

Re: [PATCH] fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo

2023-05-21 Thread Jon Turney
On 12/05/2023 19:09, Brian Inglis wrote: On 2023-05-12 09:36, Jon Turney wrote: On 08/05/2023 04:12, Brian Inglis wrote: cpuid    0x0007:0 ecx:7 shstk Shadow Stack support & Windows [20]20H1/[20]2004+     => user_shstk User mode program Shadow Stack support AMD SVM  0x800

Re: [PATCH] fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo

2023-05-12 Thread Jon Turney
On 08/05/2023 04:12, Brian Inglis wrote: cpuid0x0007:0 ecx:7 shstk Shadow Stack support & Windows [20]20H1/[20]2004+ => user_shstk User mode program Shadow Stack support AMD SVM 0x800a:0 edx:25 vnmi virtual Non-Maskable Interrrupts Sync AMD 0x8008:0 ebx

Re: [PATCH v4 1/3] Allow deriving the current user's home directory via the HOME variable

2023-03-28 Thread Jon Turney
On 28/03/2023 11:35, Corinna Vinschen wrote: Apart from the doc change, the patch is ok now. The preceding text says "Four schema are predefined, two schemata are variable", then we add "env" to both lists? That doesn't make much sense to me. Surely it's just a "predefined schema"? In any

Re: [PATCH 0/3] fix unlink/rename failure in hyper-v container

2023-03-24 Thread Jon Turney
On 24/03/2023 13:22, Corinna Vinschen wrote: On Mar 24 13:20, Jon Turney wrote: On 24/03/2023 11:54, Corinna Vinschen wrote: On Mar 24 01:40, Yoshinao Muramatsu wrote: On 2023/03/22 2:58, Corinna Vinschen wrote: I pushed a new Cygwin DLL, test release 3.5.0-0.251.gfe2545e9faaf. This should

Re: [PATCH 0/3] fix unlink/rename failure in hyper-v container

2023-03-24 Thread Jon Turney
On 24/03/2023 11:54, Corinna Vinschen wrote: On Mar 24 01:40, Yoshinao Muramatsu wrote: On 2023/03/22 2:58, Corinna Vinschen wrote: I pushed a new Cygwin DLL, test release 3.5.0-0.251.gfe2545e9faaf. This should do what we want, now. If you can confirm, I'll push your workaround afterwards.

[PATCH] Cygwin: doc: Upate a link from gitweb to cgit

2023-03-14 Thread Jon Turney
Also, reword 'considerable patch' to be more idomatic. --- winsup/doc/faq-api.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/doc/faq-api.xml b/winsup/doc/faq-api.xml index 6b5824cf2..c9b35f6b0 100644 --- a/winsup/doc/faq-api.xml +++ b/winsup/doc/faq-api.xml @@

Re: [PATCH] Cygwin: doc: Update postinstall/preremove scripts

2023-03-13 Thread Jon Turney
On 13/03/2023 09:31, Corinna Vinschen wrote: Hi Jon, On Mar 8 14:17, Jon Turney wrote: Update postinstall/preremove scripts to use CYGWIN_START_MENU_SUFFIX and CYGWIN_SETUP_OPTIONS. It would be great if you could explain your change in the commit message... Yeah, that's fair. How about

[PATCH] Cygwin: doc: Update postinstall/preremove scripts

2023-03-08 Thread Jon Turney
Update postinstall/preremove scripts to use CYGWIN_START_MENU_SUFFIX and CYGWIN_SETUP_OPTIONS. --- winsup/doc/etc.postinstall.cygwin-doc.sh | 19 +++ winsup/doc/etc.preremove.cygwin-doc.sh | 8 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git

Re: Copyright outdated? in Cygwin/X FAQ 12.6 and not addressed in Cygwin FAQ 7.1 link

2023-02-20 Thread Jon Turney
On 20/02/2023 20:20, Brian Inglis wrote: Hi folks, [Addressing to patches as that's where we'll fix it, and not a general issue.] Noticed that: https://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-copyright-cygwin "12.6. Who holds the copyright on the Cygwin source code? Red Hat owns the

Re: Cygwin build utils dumper fails - new prereqs required?

2023-02-17 Thread Jon Turney
On 16/02/2023 23:02, Brian Inglis wrote: Hi folks, Building Cygwin from latest repo testing some unrelated doc patches and updated Unicode tables. Cygwin utils fails to build dumper. References to elf and binutils debuginfo, and undefined references to sframe_de-/encode

Re: [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe`

2023-02-01 Thread Jon Turney
On 01/02/2023 17:33, Corinna Vinschen wrote: On Feb 1 15:08, Johannes Schindelin wrote: A recent binutils version introduced `libsframe` and made it a dependency of `libbfd`. This caused a linker problem in the MSYS2 project, and once Cygwin upgrades to that binutils version it would cause the

[PATCH 8/8] Cygwin: CI: Run cygserver for tests

2023-01-10 Thread Jon Turney
Note that cygserver must be run using the same cygwin1.DLL as test programs, as they communicate over a named pipe whose name contains the 'installation key' (which is a hash of the cygwin1.dll's path). We run cygserver via 'cmd' to avoid the special code which handles a cygwin parent process

[PATCH 7/8] Cygwin: testsuite: Drop appending 'ntsec' to CYGWIN in cygrun wrapper

2023-01-10 Thread Jon Turney
Don't append 'ntsec' to the CYGWIN env var in the cygrun wrapper. It doesn't have any effect anymore. --- winsup/testsuite/cygrun.c | 16 1 file changed, 16 deletions(-) diff --git a/winsup/testsuite/cygrun.c b/winsup/testsuite/cygrun.c index 65d859d59..e6c4aa705 100644 ---

[PATCH 6/8] Cygwin: testsuite: Update pthread tests for default SCHED_FIFO

2023-01-10 Thread Jon Turney
Update for default (and only) thread scheduler policy is SCHED_FIFO. --- winsup/testsuite/winsup.api/pthread/inherit1.c | 8 winsup/testsuite/winsup.api/pthread/priority1.c | 6 +++--- winsup/testsuite/winsup.api/pthread/priority2.c | 8 3 files changed, 11 insertions(+), 11

[PATCH 5/8] Cygwin: testsuite: Update mutex tests for changed default mutex type

2023-01-10 Thread Jon Turney
Default mutex type is PTHREAD_MUTEX_NORMAL. Attempting to unlock an unowned mutex of that type is specified as undefined behaviour, not returning EPERM. mutex7e verfies that attempting to unlock an unowned mutex of type PTHREAD_MUTEX_ERRORCHECK returns EPERM. ---

[PATCH 4/8] Cygwin: testsuite: 64-bit fixes in pthread testcases

2023-01-10 Thread Jon Turney
Fix warnings and 64-bit issues in pthread testcases. See pthread-win32 commit 1183e5ac etc. --- winsup/testsuite/winsup.api/pthread/cancel2.c | 10 - winsup/testsuite/winsup.api/pthread/cancel3.c | 10 - winsup/testsuite/winsup.api/pthread/cancel4.c | 10 -

[PATCH 2/8] Cygwin: testsuite: Build testcases using automake

2023-01-10 Thread Jon Turney
Build all the testcase executables directly using automake, rather than passing the compiler information into DejaGnu to have it build them. (This means you get build avoidance for these executables, so they only get built once, rather than every time you run the test, and makes it much easier to

[PATCH 3/8] Cygwin: testsuite: Fix compilation warnings

2023-01-10 Thread Jon Turney
Fix the warnings the previous change surfaces. See ltp commit d5c2112f for mmap fixes. --- winsup/testsuite/libltp/include/usctest.h | 2 +- winsup/testsuite/winsup.api/ltp/execv01.c | 2 +- winsup/testsuite/winsup.api/ltp/execve01.c | 2 +- winsup/testsuite/winsup.api/ltp/execvp01.c | 2

[PATCH 1/8] Cygwin: testsuite: automake doesn't define objdir

2023-01-10 Thread Jon Turney
objdir isn't a predefined output variable in Automake (any more?), so this was just using the absolute path /testsuite as the test's temporary directory. Use builddir instead. --- winsup/testsuite/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/8] Further testsuite fixes

2023-01-10 Thread Jon Turney
ink03.c > FAIL: ltp/umask03.c > FAIL: pthread/cancel11.c > FAIL: pthread/cancel3.c > FAIL: pthread/cancel5.c > FAIL: pthread/inherit1.c > FAIL: pthread/priority1.c > FAIL: pthread/priority2.c > FAIL: systemcall.c > > === winsup Summary === > > # of ex

[PATCH] Cygwin: Run testsuite against the just-built DLL

2023-01-06 Thread Jon Turney
Since 4e7817498efc, we're just running the tests against the installed DLL. We're arranging to put the build directory on the path, but since it doesn't contain cygwin1.dll (since it's built with a different name and renamed on installation), that doesn't have any effect. Arrange to place the

[PATCH] Cygwin: Makefile: Drop all the "test dll" considerations

2022-12-21 Thread Jon Turney
After 90236c3a2cf6, the testsuite is failing, as the cygwin0.dll that the implib testsuite programs are linked with references doesn't exist anymore. We don't need to make and link with a specially named DLL, as the cygwin DLL (for a long time now) takes into consideration the path it's executing

[PATCH] Cygwin: Makefile: Also make 'cygwin0.dll'

2022-12-21 Thread Jon Turney
Hard-link the new DLL with the name 'cygwin0.dll', as that's what the testsuite expects. (Must be a hardlink as the Windows loader needs to be able to traverse the link). Fixes: 90236c3a2cf6 ("Cygwin: Makefile: build new-cygwin1.dll in a single step") --- winsup/cygwin/Makefile.am | 6 +- 1

[PATCH] Cygwin: Makefile: Build new DLL with the name 'cygwin0.dll'

2022-12-21 Thread Jon Turney
Build the new DLL with the name 'cygwin0.dll', rather than 'new-cygwin1.dll', as that's what the testsuite expects. It still gets installed with the name 'cygwin1.dll'. Fixes: 90236c3a2cf6 ("Cygwin: Makefile: build new-cygwin1.dll in a single step") --- winsup/cygwin/Makefile.am | 2 +- 1 file

Re: [PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-12-14 Thread Jon Turney
On 11/12/2022 14:45, Johannes Schindelin wrote: On December 11, 2022 2:54:02 PM GMT+01:00, Jon Turney wrote: On 05/12/2022 15:23, Johannes Schindelin wrote: On Mon, 28 Nov 2022, Corinna Vinschen wrote: On Nov 28 13:00, Jon Turney wrote: On 15/11/2022 10:46, Corinna Vinschen wrote

[PATCH 1/2] Cygwin: FAQ: Mention configure options to build with reduced dependencies

2022-12-14 Thread Jon Turney
--- winsup/doc/faq-programming.xml | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/winsup/doc/faq-programming.xml b/winsup/doc/faq-programming.xml index 632d1a173..a24b781cf 100644 --- a/winsup/doc/faq-programming.xml +++ b/winsup/doc/faq-programming.xml @@

[PATCH 2/2] Cygwin: configure: Add option to disable building 'dumper'

2022-12-14 Thread Jon Turney
Rather than guessing, based on just the presence of libbfd, add an explicit configuration option, to build dumper or not, defaulting to building it. This might have some use when bootstrapping Cygwin for a new architecture, or when building your own Cygwin-targetted cross-compiler, rather than

[PATCH 0/2] Improvements in configure options for reducing dependencies

2022-12-14 Thread Jon Turney
Jon Turney (2): Cygwin: FAQ: Mention configure options to build with reduced dependencies Cygwin: configure: Add option to disable building 'dumper' winsup/configure.ac| 8 +--- winsup/doc/faq-programming.xml | 16 2 files changed, 17 insertions(+), 7

Re: [PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-12-11 Thread Jon Turney
On 05/12/2022 15:23, Johannes Schindelin wrote: On Mon, 28 Nov 2022, Corinna Vinschen wrote: On Nov 28 13:00, Jon Turney wrote: On 15/11/2022 10:46, Corinna Vinschen wrote: It would be great if we could get used to using the same syntax as the Linux kernel project to document stuff. I'm

Re: [PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-11-28 Thread Jon Turney
On 15/11/2022 10:46, Corinna Vinschen wrote: It would be great if we could get used to using the same syntax as the Linux kernel project to document stuff. I'm trying to follow their lead for a while. For fixes to former commits, it looks like this in the kernel, at the end of the commit

Re: [PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-11-12 Thread Jon Turney
On 04/11/2022 15:29, Pedro Alves wrote: On 2022-11-04 12:53 p.m., Jon Turney wrote: + + (It may be necessary to use the gdb command set + disable-randomization on to turn off ASLR for the debugee to + prevent the base address getting randomized.) + Typo: debugee -> debuggee Tha

Re: [PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-11-04 Thread Jon Turney
On 04/11/2022 10:34, Corinna Vinschen wrote: On Nov 3 11:22, Jeremy Drake via Cygwin-patches wrote: On Thu, 3 Nov 2022, Jon Turney wrote: gdb supports 'set disable-randomization off' on Windows since [1] (included in gdb 13). https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h

[PATCH] Cygwin: Improve FAQ on early breakpoint for ASLR

2022-11-03 Thread Jon Turney
gdb supports 'set disable-randomization off' on Windows since [1] (included in gdb 13). https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=bcb9251f029da8dcf360a4f5acfa3b4211c87bb0;hp=8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008 --- winsup/doc/faq-programming.xml | 6 ++ 1 file

Re: [PATCH 3/3] Cygwin: Add loaded module base address list to stackdump

2022-11-03 Thread Jon Turney
On 29/10/2022 09:32, Corinna Vinschen wrote: On Oct 28 16:05, Jon Turney wrote: This adds an extra section to the stackdump, which lists the loaded modules and their base address. This is perhaps useful as it makes it immediately clear if RandomCrashInjectedDll.dll is loaded... XXX: It seems

[PATCH 2/3] Cygwin: Add addresses as module offsets in .stackdump file

2022-10-28 Thread Jon Turney
This adds an additional column to the stack trace in a .stackdump file, which gives the stack frame return address as a module name+offset. This makes it a possible to convert the address to a function name without having to guess what module the address belongs to. > Stack trace: > Frame

[PATCH 1/3] Cygwin: Tidy up formatting of stackdump

2022-10-28 Thread Jon Turney
Resize stackdump headers for b9e97f58 Consistently use \r\n line endings --- winsup/cygwin/exceptions.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index e6f868511..a15bc16c5 100644 ---

  1   2   3   4   5   >