X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BC6A385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1693177705; bh=FHrhyovhUeIl+6aub5qhC0plwscmAJrCBSrTyUmKmgA=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Wvvktz3ovHjMughMfJECBWawJqXz9rtCNu6NzpqujXJxTvzmqd8KEBo55B98ueUxk FSBaJCysklFK+bVsfBl8ZTB/Qp19cOnk47SG2IE1sjdmE3l9H3s5pRNh4bSxHzIiVK XgScfm0lzEXVxhWeTynR0E0rUshgGtILg/0fif+g= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 029293858D28 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693177684; x=1693782484; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FoggED2jjAl7IsgpKCXC3/wGpUqD9yNDf3zVd5pIIy4=; b=cFKgx5xla/cjc4gi4jEh5MzBVYHqp6IiAbfGSty2Ru2mJ3RkiOB9rg2d8DFXW78Fl+ xwAUn+TcgL60QCCuFnGqUlJkKSXFwa4u+5K47KNN/qq+t8wv+tn3XpnzaP4d0tIMpSsc z68ATFgMFJCJpeIZ+9wbxCn1K/WO5rwmf2FYJMC8LaGTU7jUYBkuGbYMM4ekIUfxLGoN sfuKAMzxbi8IUcOkV1E1AAcx+l3PNuWFQV3zAMo4iVonAsdtPl+zf1McJ+b0XO9hMd7i lML55H3C2NGNT2u0BpY7FTu5xcwnbvskGhlW/W+JYVny3rABqG3JAlTWrIKn1rdofgnD S5kg== X-Gm-Message-State: AOJu0YxF4FdD3zXN+iOX2kCgNe6eSlUstWNa3G/Ra8Jk9PDDKGnLreVt vb5BPhbqeE3aFqS42kQnplJqC+HJC1ZA8ayCmicfxGWb7eE= X-Google-Smtp-Source: AGHT+IGfDFbLetapaahlb6R23U5RfICBRkWTwnXJ6zZEI+QjPSZh/6FNa//SSvKZMN+G1WZEyRMK+ohXEdY0j3IpxDg= X-Received: by 2002:a05:6512:ea4:b0:4fb:8c52:611 with SMTP id bi36-20020a0565120ea400b004fb8c520611mr22508523lfb.38.1693177684170; Sun, 27 Aug 2023 16:08:04 -0700 (PDT) MIME-Version: 1.0 References: <0b55205e-fc7c-98cf-c186-783e5c0655b0 AT comcast DOT net> In-Reply-To: <0b55205e-fc7c-98cf-c186-783e5c0655b0@comcast.net> Date: Sun, 27 Aug 2023 19:07:36 -0400 Message-ID: Subject: Re: gawk core dumped on too many input values To: cygwin AT cygwin DOT com Cc: Ed Morton X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Jeremy Hetzler via Cygwin Reply-To: Jeremy Hetzler Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 37RN8PnX031631 On Sun, Aug 27, 2023 at 2:25 PM Ed Morton via Cygwin 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/ -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple