From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18743 invoked by alias); 13 Aug 2017 20:50:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41539 Received: (qmail 13747 invoked by uid 1010); 13 Aug 2017 20:49:59 -0000 X-Qmail-Scanner-Diagnostics: from mx.spodhuis.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.142.241.89):SA:0(-2.3/5.0):. Processed in 2.207036 secs); 13 Aug 2017 20:49:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: zsh-workers+phil.pennock@spodhuis.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201708; h=Content-Type:MIME-Version:Message-ID:Subject:To: From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ubl80xetwQj2nRVSbUwAeMGN+c+k0hESFGFRhkAYqd0=; b=vqwPiufdMqo6EQmy/ImKJcYK1q 5jPBw2ktdtol7Ishq9ioYnzg6OqS/8flL0NlPSz5WcDYpByUya4Yo8Uk2yazbeycukmeBypQ6Rjic pQgvDPhNyoKjKC/GigvbGGxfDCjWvXkSTJJXO+Vv8VC3CJAQdkh7Qhh0Ml0AYFQPdwq5JKONSWiDj +0J8YIwFcbjarVjOb5VTC/Vc5x8u; Date: Sun, 13 Aug 2017 16:49:50 -0400 From: Phil Pennock To: zsh-workers@zsh.org Subject: 5.4.1 regression: PCRE with bash_rematch Message-ID: <20170813204949.GA98824@tower.spodhuis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc I'm still trying to track this down, but getting what I have out there because in checking just now, I saw that a 5.4.2 might be imminent and I think this should block. % /usr/local/Cellar/zsh/5.4.1/bin/zsh -f osmium% setopt rematchpcre bash_rematch osmium% [[ "server" =~ ^[^@:/]+$ ]] zsh: segmentation fault (core dumped) /usr/local/Cellar/zsh/5.4.1/bin/zsh -f One of my git utility scripts broke on me when I tried to use it today, with 5.4.1 on macOS installed by brew. `brew switch zsh 5.3.1_1` got it working again. With a local git-head install built with memory debugging, I get more details. zsh(29859,0x7fffe51263c0) malloc: *** mach_vm_map(size=18446744071562072064) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug +./git-clone-each-pdp:49> [[ "$Remote" -pcre-match ^[^@:/]+$./git-clone-each-pdp:49: fatal error: out of memory The line is: elif [[ "$Remote" =~ ^[^@:/]+$ ]]; then The value of Remote is just "server" (without quotes). rematchpcre bash_rematch and ksh_arrays are set, only the first two are needed to reproduce under -f; actually only bash_rematch if -pcre-match is explicit: % /opt/zsh-devel/bin/zsh -f osmium% setopt bash_rematch osmium% zmodload zsh/pcre osmium% [[ "server" -pcre-match ^[^@:/]+$ ]] zsh: segmentation fault (core dumped) /opt/zsh-devel/bin/zsh -f With that last one: -------------------------------8< lldb >8------------------------------- % lldb -c /cores/core.29982 zsh (lldb) target create "zsh" --core "/cores/core.29982" warning: (x86_64) /cores/core.29982 load command 367 LC_SEGMENT_64 has a fileoff + filesize (0x2d11f000) that extends beyond the end of the file (0x2d11e000), the segment will be truncated to match warning: (x86_64) /cores/core.29982 load command 368 LC_SEGMENT_64 has a fileoff (0x2d11f000) that extends beyond the end of the file (0x2d11e000), ignoring this section Core file '/cores/core.29982' (x86_64) was loaded. (lldb) bt * thread #1, stop reason = signal SIGSTOP * frame #0: 0x0000000108abeef0 zsh`metafy + 64 frame #1: 0x0000000108c185c8 pcre.so`___lldb_unnamed_symbol4$$pcre.so + 360 frame #2: 0x0000000108c18b2b pcre.so`___lldb_unnamed_symbol5$$pcre.so + 619 frame #3: 0x0000000108a4df86 zsh`evalcond + 1254 frame #4: 0x0000000108a55992 zsh`___lldb_unnamed_symbol30$$zsh + 98 frame #5: 0x0000000108a50a61 zsh`___lldb_unnamed_symbol18$$zsh + 497 frame #6: 0x0000000108a50325 zsh`execlist + 869 frame #7: 0x0000000108a4ff93 zsh`execode + 195 frame #8: 0x0000000108a6dcfc zsh`loop + 812 frame #9: 0x0000000108a70ee4 zsh`zsh_main + 1476 frame #10: 0x00007fffdc212235 libdyld.dylib`start + 1 frame #11: 0x00007fffdc212235 libdyld.dylib`start + 1 -------------------------------8< lldb >8-------------------------------