On Mon, Aug 11, 2014 at 11:49:16AM -0700, Petr Vandrovec wrote:
> Hi,
>   it seems to be gcc bug.  For inexplicable reason compiler optimized
> 'if (cp && *cp)' to just 'if (*cp)' :-(

> Changing 'char *cp' to 'char * volatile cp' at line 468 in
> support/export/client.c is enough to explain to gcc that it has no
> idea what it is doing, and fixes the crash.

> I think that after code does 'strncpy(new, old, cp-old)' or
> 'new[cp-old] = 0' or 'if (cp != old && *cp)' compiler believes 'cp'
> cannot be NULL, forgetting that both 'cp' and 'old' could have been
> NULL, making these expressions valid for NULL cp.

Are you seeing this problem on i386 (like the original submitter), or do you
see this problem on a different architecture?

(If it's a compiler problem, this will be relevant to getting it fixed
properly.)

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org

Attachment: signature.asc
Description: Digital signature

Reply via email to