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

2024-01-12 Thread Corinna Vinschen
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/winsup/doc/misc-funcs.xml > @@ -106

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

2024-01-12 Thread Corinna Vinschen
On Jan 12 14:09, Jon Turney wrote: > Write a coredump under 'ulimit -c' control and related changes. > > The idea here is to make debugging using a coredump work as usual on a unix, > e.g.: > > $ ulimit -c unlimited > > $ ./segv-program > *** starting '"C:\cygwin64\bin\dumper.exe" > "C:\cygwin6

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

2024-01-12 Thread Corinna Vinschen
On Jan 12 14:09, Jon Turney wrote: > On 11/01/2024 09:42, Corinna Vinschen wrote: > > I see. It's a bit unfortunate though, if dumper tries to create > > a 2 Gigs file which is later truncated, if we're low on disk space. > > But yeah, disk space isn't much of a problem these days, I guess... > >

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

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

[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 b/winsup/cygwin/mm/cygheap.cc

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

2024-01-12 Thread Jon Turney
Write a coredump under 'ulimit -c' control and related changes. The idea here is to make debugging using a coredump work as usual on a unix, e.g.: $ ulimit -c unlimited $ ./segv-program *** starting '"C:\cygwin64\bin\dumper.exe" "C:\cygwin64\work\segv-program.exe" 16156' for pid 1398, tid 7136

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. (N