Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cores almost on demand in patcompile()



[Sorry, fat-fingered the send button]

On Mon, Oct 10, 2016 at 7:46 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:

> On Mon, Oct 10, 2016 at 8:31 AM, Sebastian Gniazdowski <
> sgniazdowski@xxxxxxxxx> wrote:
>
>> My new observations:
>> – the "ndash", .i.e. this char: >>> – <<<, has a role, because
>> replacing it with other char, also one like §, stops core dump
>>
>
> Your stack trace in the first message on this thread has a string as the
> "exp" argument of patcompile() that makes me suspicious.  The comments say
> that this argument is expected to be metafied (pattern.c 522), but as best
> I can tell it's passed down from paramsubst() tokenized but not metafied.
> (I don't have access to my usual debugging platform this week.)  One of the
> multibyte characters in the string
>

... in that exp argument, the character in the position where you
identified ndash in input2b.txt, has a byte with hex value 0x83 which would
cause it to be incorrectly interpreted as a metacharacter.  If this is the
case, this probably results in the pattern being mishandled.

There were some changes made a while ago to try to optimize memory
(re)allocation during pattern compilation and globbing.  It's quite
possible that miscounting of the number of characters in the pattern is
causing problems with the allocated buffer.  At this point though, I'm just
speculating.


Messages sorted by: Reverse Date, Date, Thread, Author