On Tue, 2019-09-03 at 04:14 +, Dmitry Goncharov via Bug reports and
discussion for GNU make wrote:
> sum_up_to_nul reads 4 bytes starting from the passed string 'p'.
> 'p' can have fewer than 4 bytes. Usually there more allocated space
> after 'p', which prevents this reading from manifesting i
On Tue, Sep 24, 2019 at 1:01 PM Paul Smith wrote:
> The reason for the "special" code here is
> performance, and unfortunately the solution proposed will reduce
> performance by a measurable amount (not huge but measurable).
Paul, is this call to strlen that you are concerned with?
It is possible
On Wed, 2019-09-25 at 08:29 +, Edward Welbourne wrote:
> > With "normal" systems it's safe to read (only) memory beyond the end
> > of an array, at least up to the next word size, which is what this
> > code does.
>
> If you want to be able to rely on this "normal" behaviour, for the sake
> of
On Tue, 2019-09-03 at 04:14 +, Dmitry Goncharov wrote:
>> sum_up_to_nul reads 4 bytes starting from the passed string 'p'. 'p'
>> can have fewer than 4 bytes. Usually there more allocated space after
>> 'p', which prevents this reading from manifesting itself.
Usually malloc aligns its alloca
It is extremely dangerous to dereference outside and allocated range, and it
really should never be done today. As you well know, in C that is undefined.
However over the last few years the C compilers have been getting increasingly
aggressive to implement optimizations that assume that no one w
It indeed crashes with a core dump. I observed this on sunos/gcc when
p+3 points to the next page.
This should be easy to reproduce with a tool like libefence. Another
way to reproduce is to run $(wildcard hello*) in a directory with
thousands of files.
regards, Dmitry
On Tue, Sep 24, 2019 at 1:0
On Tue, 2019-09-03 at 04:14 +, Dmitry Goncharov via Bug reports and
discussion for GNU make wrote:
> sum_up_to_nul reads 4 bytes starting from the passed string 'p'.
> 'p' can have fewer than 4 bytes. Usually there more allocated space
> after 'p', which prevents this reading from manifesting i
Good morning.
sum_up_to_nul reads 4 bytes starting from the passed string 'p'.
'p' can have fewer than 4 bytes. Usually there more allocated space
after 'p', which prevents this reading from manifesting itself. This
reading manifests itself visibly when 'p' points to the end of the
allocated block