public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jeremy Hetzler <jeremyhetzler@gmail.com>
To: cygwin@cygwin.com
Cc: Ed Morton <mortoneccc@comcast.net>
Subject: Re: gawk core dumped on too many input values
Date: Sun, 27 Aug 2023 19:07:36 -0400	[thread overview]
Message-ID: <CAOh4nm=yYKtBWhWOwW9rUxu3y8vFOgRA+rW-tTzq-=q63OL_0A@mail.gmail.com> (raw)
In-Reply-To: <0b55205e-fc7c-98cf-c186-783e5c0655b0@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 2780 bytes --]

On Sun, Aug 27, 2023 at 2:25 PM Ed Morton via Cygwin <cygwin@cygwin.com>
wrote:
>
> This (original email below) turned out to be a general cygwin issue, not
> a gawk issue:
>
> $ LC_ALL=C sed 's/x/y/' $(seq 1000000)
> Segmentation fault (core dumped)
>
> $ LC_ALL=C grep 'foo' $(seq 1000000)
> Segmentation fault (core dumped)
>

Seems that all commands linked with cygwin1.dll will fault if you pass them
a long enough arglist.

For me, /bin/true faults on {1..258231} but not {1..258230}.

> $ /bin/true {1..258230}
>


> $ /bin/true {1..258231}
> Segmentation fault (core dumped)


strace, which is not linked with cygwin1.dll, exits cleanly.

> $ /bin/strace {1..300000}
> -bash: /bin/strace: Argument list too long


See this page [1] on maximum argument lengths.

It would be nice to document this limit, whatever it is.

It would also be nice to return an error to the shell on too-long arglist.

$ cat true.exe.stackdump
>
Exception: STATUS_STACK_OVERFLOW at rip=7FFD41BD4646
> rax=0000000000051F10 rbx=0000000800009991 rcx=00000007FFE03C50
> rdx=00007FFD41BF58A0 rsi=0000000000000000 rdi=0000000000000000
> r8 =FEFEFEFEFEFEFF42 r9 =00007FFD41BF5820 r10=FEFEFEFEFEFEFEFF
> r11=FEFEFEFEFEFEFEFF r12=000000080000998D r13=00000007FFFFCDF0
> r14=0000000000000000 r15=0000000000000000
> rbp=00000007FFFFCD30 rsp=00000007FFFFCC38
> program=C:\cygwin64\bin\true.exe, pid 44496, thread
> cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
> Stack trace:
> Frame         Function      Args
> 0007FFFFCD30  7FFD41BD4646 (7FFD41A08035, 7FFD41A06F80, 000000000000,
> 000000000000) cygwin1.dll+0x1D4646
> 0007FFFFCD30  000000249F10 (7FFD41A06F80, 000000000000, 000000000000,
> 000000000000)
> 0007FFFFCD30  7FFD41BF5800 (000000000000, 000000000000, 000000000000,
> 000000000000) cygwin1.dll+0x1F5800
> 0007FFFFCD30  7FFD41A08035 (000000000000, 000000000000, 000000000000,
> 000000000000) cygwin1.dll+0x8035
> 0007FFFFFFF0  7FFD41A05C86 (000000000000, 000000000000, 000000000000,
> 000000000000) cygwin1.dll+0x5C86
> 0007FFFFFFF0  7FFD41A05D34 (000000000000, 000000000000, 000000000000,
> 000000000000) cygwin1.dll+0x5D34
> End of stack trace
> Loaded modules:
> 000100400000 true.exe
> 7FFD52F30000 ntdll.dll
> 7FFD52250000 KERNEL32.DLL
> 7FFD50940000 KERNELBASE.dll
> 0005EE2D0000 cygintl-8.dll
> 7FFD41A00000 cygwin1.dll
> 0003F9F70000 cygiconv-2.dll
> 7FFD51C70000 advapi32.dll
> 7FFD51FD0000 msvcrt.dll
> 7FFD525A0000 sechost.dll
> 7FFD52650000 RPCRT4.dll
> 7FFD4F3A0000 CRYPTBASE.DLL
> 7FFD50380000 bcryptPrimitives.dll



> $ uname -a
> CYGWIN_NT-10.0-22621 nzxt 3.4.8-1.x86_64 2023-08-17 17:02 UTC x86_64 Cygwin


Thanks,
Jeremy Hetzler

[1] https://www.in-ulm.de/~mascheck/various/argmax/

  reply	other threads:[~2023-08-27 23:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e0fa509d-890a-2db7-c91f-2b1d904a9a1e@comcast.net>
2023-08-27 18:24 ` Fwd: " Ed Morton
2023-08-27 23:07   ` Jeremy Hetzler [this message]
2023-08-28 11:47     ` Joshuah Hurst
2023-08-28 18:20       ` Brian Inglis
2023-08-29 13:03         ` Corinna Vinschen
2023-08-28  8:38   ` Fwd: " Takashi Yano

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='CAOh4nm=yYKtBWhWOwW9rUxu3y8vFOgRA+rW-tTzq-=q63OL_0A@mail.gmail.com' \
    --to=jeremyhetzler@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=mortoneccc@comcast.net \
    /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).