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

Re: Cores almost on demand in patcompile()



On Thu, 20 Oct 2016 12:30:50 +0200
Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Valgrind points at patadd(NULL, 0, nmeta, 0). Wonder why not to its
> interior? But to all logic, problem should be inside patadd() because
> nothing else near dereferences a pointer. So there might be two
> problems. Debugger didn't report inaccessible memory when I did
> step-over on the patadd(), maybe memory is accessible but invalid from
> other reason recognized by Valgrind.

Just to be sure, could you confirm the problem goes away if you change
line 292 of pattern.c

/* Default size for pattern buffer */
#define P_DEF_ALLOC 256

to

/* Default size for pattern buffer */
#define P_DEF_ALLOC 512

?  That's not a fix, it's just putting off the problem, but if it's
initially allocating something larger than what your pattern needs I'd
expect the crash not to happen.

pws



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