public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
Cc: cygwin-patches@cygwin.com
Subject: Re: [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump
Date: Tue, 16 Jan 2024 13:52:22 +0000	[thread overview]
Message-ID: <dde2da5f-7f91-4f71-9a6f-dbedb05e1298@dronecode.org.uk> (raw)
In-Reply-To: <ZaVBHu-dY8_FOvm0@calimero.vinschen.de>

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 = wcpcpy (cp, dll_dir);
>>>>> +  cp = wcpcpy (cp, L"\\dumper.exe");
>>>>> +  cp = wcpcpy (cp, L"\" ");
>>>>> +  cp = wcpcpy (cp, L"\"");
>>>>> +  cp = wcpcpy (cp, global_progname);
>>>>
>>>> I wonder if this should be program_invocation_short_name, so that the
>>>> coredump is created in the cwd, rather than next to the executable.

So, when I actually look further into this, what I wrote is utter 
nonsense. dumper/minidumper includes the following:

>       ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE,
>                                       *(argv + optind), NULL, 0);
>       char *win32_name = (char *) alloca (len);
>       cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE,  *(argv + optind),
>                         win32_name, len);
>       if ((p = strrchr (win32_name, '\\')))
>         p++;
>       else
>         p = win32_name;

My eyes moving over this lightly, my brain assumes it just converts from 
a Win32 path to a POSIX path, but actually it does:

1) convert from POSIX path to Windows path (assuming it's a no-op if the 
path is already in a Windows form
2) (now having a consistent path delimiter) use the part after the last 
delimiter (if any), as the basename.

So: no problem here, after all. coredump file is already created in the cwd.


  reply	other threads:[~2024-01-16 13:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 14:09 [PATCH 0/5] Coredump under 'ulimit -c' control (v2) Jon Turney
2024-01-12 14:09 ` [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump Jon Turney
2024-01-13 14:20   ` Jon Turney
2024-01-15  9:46     ` Corinna Vinschen
2024-01-15 13:27       ` Jon Turney
2024-01-15 14:28         ` Corinna Vinschen
2024-01-16 13:52           ` Jon Turney [this message]
2024-01-16 13:54             ` Corinna Vinschen
2024-01-23 14:20   ` Jon Turney
2024-01-23 14:29     ` Corinna Vinschen
2024-01-24 13:28       ` Jon Turney
2024-01-24 14:39         ` Corinna Vinschen
2024-01-25 14:50           ` Jon Turney
2024-01-25 18:21             ` Corinna Vinschen
2024-01-25 20:03               ` Jon Turney
2024-01-26 11:12                 ` Corinna Vinschen
2024-01-26 11:52                   ` Corinna Vinschen
2024-01-27 15:12                     ` Jon Turney
2024-01-29 11:16                       ` Corinna Vinschen
2024-01-12 14:09 ` [PATCH 2/5] Cygwin: Disable writing core dumps by default Jon Turney
2024-01-12 14:09 ` [PATCH 3/5] Cygwin: Define and use __WCOREFLAG Jon Turney
2024-01-12 14:09 ` [PATCH 4/5] Cygwin: Treat api_fatal() similarly to a core-dumping signal Jon Turney
2024-01-12 14:09 ` [PATCH 5/5] Cygwin: Update documentation for cygwin_stackdump Jon Turney
2024-01-12 18:44   ` Corinna Vinschen
2024-01-13 13:40     ` Jon Turney
2024-01-12 18:41 ` [PATCH 0/5] Coredump under 'ulimit -c' control (v2) Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dde2da5f-7f91-4f71-9a6f-dbedb05e1298@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).