[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#619963: marked as done (gcc-4.6: wrongly optimizes memmove() into memcpy())



Your message dated Tue, 24 May 2011 13:03:25 +0200
with message-id <20110524110325.GA27774@volta.aurel32.net>
and subject line Re: memmove
has caused the Debian Bug report #619963,
regarding gcc-4.6: wrongly optimizes memmove() into memcpy()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
619963: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619963
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-4.6
Version: 4.6.0-1
Severity: grave
Justification: renders package unusable


	Hello,

Trying to compile VLC media player using Debian gcc-4.6.
It turns out that the compiler is silently replacing memmove() calls
with memcpy() ones, when it is clearly NOT a legal optimization. The
issue was uncovered with valgrind. For instance, this one is failing,
even though both source and destination obviously overlap:

     memmove( &p_aout->pp_inputs[i_input], &p_aout->pp_inputs[i_input + 1],
              (AOUT_MAX_INPUTS - i_input - 1) * sizeof(aout_input_t *) );

This results in memory corruption at run-time and eventually crashes.

Compiler flags used were: -g -O2 -ffast-math -funroll-loops -fPIC
I can provide the full .i file if needed.

Best regards,

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (100, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-1-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.6 depends on:
ii  binutils               2.21.0.20110327-1 The GNU assembler, linker and bina
ii  cpp-4.6                4.6.0-1           The GNU C preprocessor
ii  gcc-4.6-base           4.6.0-1           The GNU Compiler Collection (base 
ii  libc6                  2.11.2-11         Embedded GNU C Library: Shared lib
ii  libcloog-ppl0          0.15.9-3          the Chunky Loop Generator (runtime
ii  libgcc1                1:4.6.0-1         GCC support library
ii  libgmp10               2:5.0.1+dfsg-7    Multiprecision arithmetic library
ii  libgmpxx4ldbl          2:5.0.1+dfsg-7    Multiprecision arithmetic library 
ii  libgomp1               4.6.0-1           GCC OpenMP (GOMP) support library
ii  libmpc2                0.9-2             multiple precision complex floatin
ii  libmpfr4               3.0.0-9           multiple precision floating-point 
ii  libppl-c4              0.11.2-3          Parma Polyhedra Library (C interfa
ii  libppl9                0.11.2-3          Parma Polyhedra Library (runtime l
ii  libquadmath0           4.6.0-1           GCC Quad-Precision Math Library
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

Versions of packages gcc-4.6 recommends:
ii  libc6-dev                     2.11.2-11  Embedded GNU C Library: Developmen

Versions of packages gcc-4.6 suggests:
pn  binutils-gold                 <none>     (no description available)
pn  gcc-4.6-doc                   <none>     (no description available)
pn  gcc-4.6-locales               <none>     (no description available)
pn  gcc-4.6-multilib              <none>     (no description available)
ii  libgcc1-dbg                   1:4.6.0-1  GCC support library (debug symbols
pn  libgomp1-dbg                  <none>     (no description available)
pn  libmudflap0-4.6-dev           <none>     (no description available)
pn  libmudflap0-dbg               <none>     (no description available)
pn  libquadmath0-dbg              <none>     (no description available)

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 2.13-1

On Sun, Apr 10, 2011 at 12:18:43PM +0300, Török Edwin wrote:
> Marc Glisse wrote:
> > Hello,
> > 
> > in the prototype of memmove (taken from glibc bits/string3.h), you will 
> > notice __restrict in front of the arguments. This is not present in more 
> > recent glibc versions and is a likely cause of your trouble.
> > 
> 
> Indeed if I remove __restrict the bug is gone, and if I upgrade to libc6
> 2.13-0exp5, VLC's dec.c seems to be compiled correctly too.

This bug has been fixed in eglibc 2.13-1. Closing the bug.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


--- End Message ---

Reply to: