This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: Segmentation fault with gcc 4.5.0 and glibc 2.6.1


I have compiled the gcc 4.5.0 version with the help of this I have
compiled the glibc 2.6.1. Now I am getting segmentation fault on
shared library simple application. Static application works fine.

I am attaching configure build log at the end.

Test c file.
void main()
{
? ? ? ?printf("TEST\n");
? ? ? ?return ;
}


Kernel verbose debug message dump
/a.out
TEST
a.out: unhandled page fault (11) at 0x00014850, code 0x000
pgd = ca120000
[00014850] *pgd=0a08a031, *pte=00000000, *ppte=00000000

Pid: 272, comm: ? ? ? ? ? ? ? ?a.out
CPU: 0 ? ?Not tainted ?(2.6.27-ndk15b06-00155-ge890587-dirty #6)
PC is at 0x14850
LR is at 0x4000ce58
pc : [<00014850>] ? ?lr : [<4000ce58>] ? ?psr: 20000010
sp : be92ed10 ?ip : 00000000 ?fp : be92ed7c
r10: 00000003 ?r9 : be92ed18 ?r8 : 00000000
r7 : 40021e34 ?r6 : 40019650 ?r5 : 401216f4 ?r4 : 00000001
r3 : 00014850 ?r2 : 401216f8 ?r1 : 40021e08 ?r0 : 40022290
Flags: nzCv ?IRQs on ?FIQs on ?Mode USER_32 ?ISA ARM ?Segment user
Control: 0005317f ?Table: 0a120000 ?DAC: 00000015
[<c0025c90>] (show_regs+0x0/0x50) from [<c002a6f8>] (__do_user_fault+0x5c/0xa4)
?r4:ca04cca0 r3:00000000
[<c002a69c>] (__do_user_fault+0x0/0xa4) from [<c002a9c0>]
(do_page_fault+0x204/0x238)
?r7:00014850 r6:ca167ac8 r5:ca11dfb0 r4:ca04cca0
[<c002a7bc>] (do_page_fault+0x0/0x238) from [<c002aa80>]
(do_translation_fault+0x18/0x7c)
[<c002aa68>] (do_translation_fault+0x0/0x7c) from [<c0024310>]
(do_PrefetchAbort+0x18/0x1c)
?r6:40019650 r5:401216f4 r4:ffffffff r3:20000010
[<c00242f8>] (do_PrefetchAbort+0x0/0x1c) from [<c0024d00>]
(ret_from_exception+0x0/0x10)
Exception stack(0xca11dfb0 to 0xca11dff8)
dfa0: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 40022290 40021e08 401216f8 00014850
dfc0: 00000001 401216f4 40019650 40021e34 00000000 be92ed18 00000003 be92ed7c
dfe0: 00000000 be92ed10 4000ce58 00014850 20000010 ffffffff
Segmentation fault


Strace dump
strace ?/a.out
execve("/a.out", ["/a.out"], [/* 7 vars */]) = 0
brk(0) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?= 0x11000
uname({sys="Linux", node="NDK10_170", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40019000
access("/etc/ld.so.preload", R_OK) ? ? ?= -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) ? ? ?= -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/lib/tls/v5l/fast-mult/half", 0xbefe93d8) = -1 ENOENT (No such
file or directory)
open("/lib/tls/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/lib/tls/v5l/fast-mult", 0xbefe93d8) = -1 ENOENT (No such file
or directory)
open("/lib/tls/v5l/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/tls/v5l/half", 0xbefe93d8) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l", 0xbefe93d8) ? ? ?= -1 ENOENT (No such file or directory)
open("/lib/tls/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/lib/tls/fast-mult/half", 0xbefe93d8) = -1 ENOENT (No such
file or directory)
open("/lib/tls/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/tls/fast-mult", 0xbefe93d8) = -1 ENOENT (No such file or directory)
open("/lib/tls/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/tls/half", 0xbefe93d8) ? ? = -1 ENOENT (No such file or directory)
open("/lib/tls/libc.so.6", O_RDONLY) ? ?= -1 ENOENT (No such file or directory)
stat64("/lib/tls", 0xbefe93d8) ? ? ? ? ?= -1 ENOENT (No such file or directory)
open("/lib/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/lib/v5l/fast-mult/half", 0xbefe93d8) = -1 ENOENT (No such
file or directory)
open("/lib/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/v5l/fast-mult", 0xbefe93d8) = -1 ENOENT (No such file or directory)
open("/lib/v5l/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/v5l/half", 0xbefe93d8) ? ? = -1 ENOENT (No such file or directory)
open("/lib/v5l/libc.so.6", O_RDONLY) ? ?= -1 ENOENT (No such file or directory)
stat64("/lib/v5l", 0xbefe93d8) ? ? ? ? ?= -1 ENOENT (No such file or directory)
open("/lib/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/fast-mult/half", 0xbefe93d8) = -1 ENOENT (No such file or
directory)
open("/lib/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/lib/fast-mult", 0xbefe93d8) ? ?= -1 ENOENT (No such file or directory)
open("/lib/half/libc.so.6", O_RDONLY) ? = -1 ENOENT (No such file or directory)
stat64("/lib/half", 0xbefe93d8) ? ? ? ? = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) ? ? ? ?= 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\20L\1\0004\0\0\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1337198, ...}) = 0
mmap2(NULL, 1061368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0x40023000
mprotect(0x40119000, 32768, PROT_NONE) ?= 0
mmap2(0x40121000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf6) = 0x40121000
mmap2(0x40124000, 8696, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40124000
close(3) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?= 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x4001a000
set_tls(0x4001a090, 0x4001a768, 0x40022050, 0x4001a090, 0x40022000) = 0
mprotect(0x40121000, 8192, PROT_READ) ? = 0
mprotect(0x40021000, 4096, PROT_READ) ? = 0
fstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(5, 1), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon
echo ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x4001b000
write(1, "TEST\n", 5TEST
) ? ? ? ? ? ? ? ? ? = 5
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

glibc build log

+ ../configure --host=arm-926ejs-linux-gnueabi
--build=i686-pc-linux-gnu --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
--libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/usr/share --mandir=/usr/share/man
--infodir=/usr/share/info --with-tls --with-__thread --enable-shared
--enable-stackguard-randomization --enable-add-ons=ports,nptl
--enable-shared --disable-libunwind-exceptions --without-fp
--with-tls=force --build=i686-pc-linux-gnu --enable-kernel=2.6.16
--without-cvs --disable-profile --disable-debug --without-gd
--with-headers=/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/target/usr/include
configure: loading site script
/home/ramd/CVS/cortex-install/STLinux-2.4/config/config.site.armv5
checking build system type... i686-pc-linux-gnu
checking host system type... arm-926ejs-linux-gnueabi
checking add-on ports for preconfigure fragments... am33 arm hppa m68k mips
configure: running configure fragment for add-on nptl
checking sysdep dirs... ports/sysdeps/arm/elf
ports/sysdeps/unix/sysv/linux/arm/eabi/nptl
ports/sysdeps/unix/sysv/linux/arm/eabi
ports/sysdeps/unix/sysv/linux/arm/nptl
ports/sysdeps/unix/sysv/linux/arm ports/sysdeps/unix/sysv/linux
nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread
sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common
sysdeps/unix/mman sysdeps/unix/inet ports/sysdeps/unix/sysv
nptl/sysdeps/unix/sysv sysdeps/unix/sysv ports/sysdeps/unix/arm
ports/sysdeps/unix nptl/sysdeps/unix sysdeps/unix sysdeps/posix
ports/sysdeps/arm/eabi ports/sysdeps/arm/nptl ports/sysdeps/arm
sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64
sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for arm-926ejs-linux-gnueabi-gcc... armv5-linux-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv5-linux-gcc accepts -g... yes
checking for armv5-linux-gcc option to accept ANSI C... none needed
checking for gcc... gcc
checking how to run the C preprocessor... armv5-linux-gcc -E
checking for arm-926ejs-linux-gnueabi-g++... armv5-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether armv5-linux-g++ accepts -g... yes
checking whether
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/as
is GNU as... yes
checking whether
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/ld
is GNU ld... yes
checking for /home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/as...
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/as
checking version of
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/as...
2.19.51.0.1.20090106, ok
checking for /home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/ld...
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/ld
checking version of
/home/ramd/CVS/cortex-install/STLinux-2.4/devkit/armv5/lib/gcc/arm-926ejs-linux-gnueabi/4.5.0/../../../../arm-926ejs-linux-gnueabi/bin/ld...
2.19.51.0.1.20090106, ok
checking for pwd... /bin/pwd
checking for arm-926ejs-linux-gnueabi-gcc... (cached) armv5-linux-gcc
checking version of armv5-linux-gcc... 4.5.0, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.17, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.11, ok
checking for sed... sed
checking version of sed... 4.1.5, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/sh
checking for gawk... gawk
checking for perl... /usr/bin/perl
checking for install-info... /sbin/install-info
checking for bison... /usr/bin/bison
checking for signed size_t type... no
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for .set assembler directive... yes
checking for assembler .type directive prefix... %
checking for .symver assembler directive... yes
checking for ld --version-script... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -Bgroup option... yes
checking for libgcc_s suffix...
checking for --as-needed option... yes
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for -z execstack... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for -fno-toplevel-reorder... yes
checking for -fstack-protector... (cached) yes
checking for -fgnu89-inline... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking whether CFI directives are supported... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_expect... yes
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for long double... yes
checking size of long double... 8
running configure fragment for ports/sysdeps/arm/elf
checking for ARM TLS support... yes
running configure fragment for ports/sysdeps/unix/sysv/linux/arm/eabi/nptl
running configure fragment for ports/sysdeps/unix/sysv/linux/arm/eabi
running configure fragment for nptl/sysdeps/pthread
checking for forced unwind support... (cached) yes
checking for C cleanup handling... (cached) yes
running configure fragment for sysdeps/pthread
running configure fragment for sysdeps/unix/sysv/linux
checking for egrep... (cached) grep -E
checking installed Linux kernel header files... 2.0.10 or later
checking for kernel header at least 2.6.16... ok
checking for old glibc 2.0.x headers... no
checking whether -fPIC is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: executing default commands

Please somebody help on this?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]