I can confirm this Problem using a old version of gcc for cross
compiling.:

ppc_8xx-gcc (GCC) 4.2.2
Copyright (C) 2007 Free Software Foundation, Inc.

The problem is the parsing of the include paths:

Output of strace:
15791 
stat64("/opt/eldk_4.2/ppsr/libusr/lib/gcc/powerpc-linux//includude/c++/4./c++/4.2.2/powerpc-linux",
 0xffc9eb00) = -1 ENOENT (No such file or directory)
15791 
stat64("/opt/eldk_4.2/ppsr/libusr/lib/gcc/powerpc-linux//includude/c++/4./c++/4.2.2/backward",
 0xffc9eb00) = -1 ENOENT (No such file or directory)

As you can see the path was mixed up and therefore the include files
could not be found.

Output of ltrace:
15801 strchr("/opt/eldk_4.2/usr/../ppc_8xx/usr"..., '/')                        
                     = "/opt/eldk_4.2/usr/../ppc_8xx/usr"...
15801 strchr("opt/eldk_4.2/usr/../ppc_8xx/usr/"..., '/')                        
                     = "/eldk_4.2/usr/../ppc_8xx/usr/lib"...
15801 strchr("eldk_4.2/usr/../ppc_8xx/usr/lib/"..., '/')                        
                     = "/usr/../ppc_8xx/usr/lib/gcc/powe"...
15801 strchr("usr/../ppc_8xx/usr/lib/gcc/power"..., '/')                        
                     = "/../ppc_8xx/usr/lib/gcc/powerpc-"...
15801 strcpy(0x092d87cd, "/ppc_8xx/usr/lib/gcc/powerpc-lin"...)                 
                     = 0x092d87cd
15801 strchr("/ppsr/libusr/lib/gcc/powerpc-lin"..., '/')                        
                     = "/ppsr/libusr/lib/gcc/powerpc-lin"...
15801 strchr("ppsr/libusr/lib/gcc/powerpc-linu"..., '/')                        
                     = "/libusr/lib/gcc/powerpc-linux/./"...
15801 strchr("libusr/lib/gcc/powerpc-linux/./."..., '/')                        
                     = "/lib/gcc/powerpc-linux/./../../."...
15801 strchr("lib/gcc/powerpc-linux/./../../.."..., '/')                        
                     = "/gcc/powerpc-linux/./../../../in"...
15801 strchr("gcc/powerpc-linux/./../../../inc"..., '/')                        
                     = "/powerpc-linux/./../../../includ"...
15801 strchr("powerpc-linux/./../../../include"..., '/')                        
                     = "/./../../../include/c++/4./c++/4"...
15801 strcpy(0x092d87ef, "/../../../include/c++/4./c++/4.2"...)                 
                     = 0x092d87ef
15801 strchr("../../includude/c++/4./c++/4.2.2"..., '/')                        
                     = "/../includude/c++/4./c++/4.2.2/p"...
15801 strcpy(0x092d87f0, "/includude/c++/4./c++/4.2.2/powe"...)                 
                     = 0x092d87f0
15801 strchr("/includude/c++/4./c++/4.2.2/powe"..., '/')                        
                     = "/includude/c++/4./c++/4.2.2/powe"...
15801 strchr("includude/c++/4./c++/4.2.2/power"..., '/')                        
                     = "/c++/4./c++/4.2.2/powerpc-linux"
15801 strchr("c++/4./c++/4.2.2/powerpc-linux", '/')                             
                     = "/4./c++/4.2.2/powerpc-linux"
15801 strchr("4./c++/4.2.2/powerpc-linux", '/')                                 
                     = "/c++/4.2.2/powerpc-linux"
15801 strchr("c++/4.2.2/powerpc-linux", '/')                                    
                     = "/4.2.2/powerpc-linux"
15801 strchr("4.2.2/powerpc-linux", '/')                                        
                     = "/powerpc-linux"
15801 strchr("powerpc-linux", '/')                                              
                     = NULL

Its obvious that the function strcpy is the source of the problem. The
solution in the comment above solve the problem.

Until today we use natty to compile for ppc. This bug is now popped up
while migrating to precise. That means that this bug does not contain
libc6 (2.13-0ubuntu13.1).

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/810739

Title:
  strcpy output incorrect if src and dst overlap

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/810739/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to