From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13414 invoked from network); 25 Sep 2022 11:21:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Sep 2022 11:21:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1664104893; b=Yvl86VM7bQty9aKVcIRF3j85Ut+bxwOfUQkGBvr4H7QxSsd9pu3BkG6qXnYDdkLhSf367cadK7 Ekyd7f1kl6puY2FERAk7E3NKl2COrldaVTaq3BSgosIqPcIOWYPkhajPc+mC1tRjpH8kZumNSq NtKtkKyKv0kIfmaeyxIInKWM2BnZwqhElFAfZO5pHf+7CW14vTaohC1toc73kQn83qoSsjdFVb B9D5qEhxs/MYmP0uHk3Fh6sF3Uqe8HKfzUThfy+6YuIr4F7wCmI+XT96bERO1BQs8jzURF2qpZ vOdXcvfcdSBjz8fklARxtMYEQBdDQvyiwedrZ1OKLe+o4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay5-d.mail.gandi.net) smtp.remote-ip=217.70.183.197; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1664104893; bh=SSX7oyebAcesLmsgGpNInCeCpZO/MExJCuEpBadD3VI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:DKIM-Signature; b=HHeE30Evyet6I3MoJsL6jzj1MvqPMHNeOUE2mwdwpKSQMgmJPRiNDjf/Zv6tk5YO+dme8m3+lU tKWwv7eM0c/1B63zCZZ7asxEcvBF1d54EH7K35gzWRpqmWyc1V7eaEwN/EbYNnDYHOSImnBb0S uFJYe2mTSLl3KNvU8XF2/e8DFFIGT/Id94HPwQbu2BYkRQGhZAABILIz5S05VHXxFWkTAKMUNs B6cGYrqlmEBtV5dYeq7ruQvFJcdMMhgujo4ABOrvCKIHIbDygYF6bZostLukPWomchnzZfHPns ADU3hPaesXGxps7jI4bZnnC9uKV5NLTE6dt4vk2kCG+Sag==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Yd0ovuAWPYf/SFDYjAUUZsNxHVMO3ontuhp5ZPwIxf0=; b=mVLdGJyRA745TqlisuBVY/uJMh vXy8GItud5juVVxI4UZGAvbDbNQqCIYXmYRj/f74k4PEeev8Scuy0y50sWeNlg2dD+Kt1wFnXoVU7 N0RkQXZ6+ra5DhJZACjBJ4rwRwcPFmRJMfHuslEp2kO/jdvie9WanOdoFYPxoswokvpC66jbJVvZd wGYumXr5bfc3jYFr9yBtLEPnkptyQu/hBY+nVeB3gQXBahS5lHp2eMJhl7v6ql6lfBGTjPxyrsW5o DJ2IWYbLAmgxiW6y0XJBiafXbXfATRyjydQ7RPYRJMW5xl4LTXm3FkNYnKgg91Fe6cOYYZDKwoLax idhijiZg==; Received: from authenticated user by zero.zsh.org with local id 1ocPhS-0009We-TH; Sun, 25 Sep 2022 11:21:30 +0000 Authentication-Results: zsh.org; iprev=pass (relay5-d.mail.gandi.net) smtp.remote-ip=217.70.183.197; dmarc=none header.from=chazelas.org; arc=none Received: from relay5-d.mail.gandi.net ([217.70.183.197]:57749) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1ocOyT-00088s-LC; Sun, 25 Sep 2022 10:35:02 +0000 Received: (Authenticated sender: stephane@chazelas.org) by mail.gandi.net (Postfix) with ESMTPA id 8DC731C0002; Sun, 25 Sep 2022 10:34:59 +0000 (UTC) MIME-Version: 1.0 Date: Sun, 25 Sep 2022 11:34:59 +0100 From: Stephane Chazelas To: "Jun. T" Cc: zsh-workers@zsh.org Subject: Re: [bug] busy loop and memory exhaustion on {x..$'\80'} with nomultibyte In-Reply-To: <5DEC33AD-021F-42CD-A08E-F8BDEC23BD0A@kba.biglobe.ne.jp> References: <20220923105414.mrvkpoxsejwtu7rz@chazelas.org> <5DEC33AD-021F-42CD-A08E-F8BDEC23BD0A@kba.biglobe.ne.jp> Message-ID: <9382d4c99158b30b26e6cdf9b64f225d@chazelas.org> X-Sender: stephane@chazelas.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Validation-by: kb@spambri.de X-Seq: 50666 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2022-09-24 12:04, Jun. T wrote: [...] > Does this solve the problem? [...] Thanks that's better, but now: $ echo $options[multibyte] off $ printf %s {$'\x80'..$'\xff'} | hexdump -C 00000000 5c 4d 2d 5e 40 5c 4d 2d 5e 41 5c 4d 2d 5e 42 5c |\M-^@\M-^A\M-^B\| 00000010 4d 2d 5e 43 5c 4d 2d 5e 44 5c 4d 2d 5e 45 5c 4d |M-^C\M-^D\M-^E\M| 00000020 2d 5e 46 5c 4d 2d 5e 47 5c 4d 2d 5e 48 5c 4d 2d |-^F\M-^G\M-^H\M-| 00000030 5c 74 5c 4d 2d 5c 6e 5c 4d 2d 5e 4b 5c 4d 2d 5e |\t\M-\n\M-^K\M-^| 00000040 4c 5c 4d 2d 5e 4d 5c 4d 2d 5e 4e 5c 4d 2d 5e 4f |L\M-^M\M-^N\M-^O| 00000050 5c 4d 2d 5e 50 5c 4d 2d 5e 51 5c 4d 2d 5e 52 5c |\M-^P\M-^Q\M-^R\| 00000060 4d 2d 5e 53 5c 4d 2d 5e 54 5c 4d 2d 5e 55 5c 4d |M-^S\M-^T\M-^U\M| 00000070 2d 5e 56 5c 4d 2d 5e 57 5c 4d 2d 5e 58 5c 4d 2d |-^V\M-^W\M-^X\M-| 00000080 5e 59 5c 4d 2d 5e 5a 5c 4d 2d 5e 5b 5c 4d 2d 5e |^Y\M-^Z\M-^[\M-^| 00000090 5c 5c 4d 2d 5e 5d 5c 4d 2d 5e 5e 5c 4d 2d 5e 5f |\\M-^]\M-^^\M-^_| 000000a0 c2 a0 c2 a1 c2 a2 c2 a3 c2 a4 c2 a5 c2 a6 c2 a7 |................| 000000b0 c2 a8 c2 a9 c2 aa c2 ab c2 ac c2 ad c2 ae c2 af |................| 000000c0 c2 b0 c2 b1 c2 b2 c2 b3 c2 b4 c2 b5 c2 b6 c2 b7 |................| 000000d0 c2 b8 c2 b9 c2 ba c2 bb c2 bc c2 bd c2 be c2 bf |................| 000000e0 c3 80 c3 81 c3 82 c3 83 c3 84 c3 85 c3 86 c3 87 |................| 000000f0 c3 88 c3 89 c3 8a c3 8b c3 8c c3 8d c3 8e c3 8f |................| 00000100 c3 90 c3 91 c3 92 c3 93 c3 94 c3 95 c3 96 c3 97 |................| 00000110 c3 98 c3 99 c3 9a c3 9b c3 9c c3 9d c3 9e c3 9f |................| 00000120 c3 a0 c3 a1 c3 a2 c3 a3 c3 a4 c3 a5 c3 a6 c3 a7 |................| 00000130 c3 a8 c3 a9 c3 aa c3 ab c3 ac c3 ad c3 ae c3 af |................| 00000140 c3 b0 c3 b1 c3 b2 c3 b3 c3 b4 c3 b5 c3 b6 c3 b7 |................| 00000150 c3 b8 c3 b9 c3 ba c3 bb c3 bc c3 bd c3 be c3 bf |................| 00000160 That's bytes 0x80 to 0x9f with their \M-^X representation followed by UTF-8 encoded (in my locale using UTF-8 as charmap) characters U+00A0 to U+00FF instead of bytes 0x80 to 0xff which I'd expect with nomultibyte. In any case, that (documented) transliteration of unprintable characters means I can't use it for what I initially intended to (get a range of arbitrary byte values). It seems braceccl's {$'\0'-$'\xff'} works for that though (though the documentation suggests it may not be future proof): > unchanged, unless the option BRACE_CCL (an abbreviation for 'brace > character class') is set. In that case, it is expanded to a list of > the > individual characters between the braces sorted into the order of the > characters in the ASCII character set (multibyte characters are not ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > currently handled). The syntax is similar to a [...] expression in ^^^^^^^^^^^^^^^^^^ -- Stephane