LINUX.ORG.RU

Любой исходник скопиленый gcc выдает segfault


0

0

Обратил внимание на это после очередного обновления(apt-get update && apt-get upgrade)
sk@sk:~/tmp$ cat hello.c
int main ()
{
return 0;
}
sk@sk:~/tmp$ gcc -g3 hello.c -o hello
sk@sk:~/tmp$ ./hello
Segmentation fault
sk@sk:~/tmp$ strace ./hello
execve("./hello", ["./hello"], [/* 28 vars */]) = 0
uname({sys="Linux", node="localhost", ...}) = 0
brk(0) = 0x804a000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=90288, ...}) = 0
old_mmap(NULL, 90288, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360Y\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1253924, ...}) = 0
old_mmap(NULL, 1260140, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4002f000
old_mmap(0x40158000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x129000) = 0x40158000
old_mmap(0x40160000, 10860, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40160000
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40163000
set_thread_area({entry_number:-1 -> 6, base_addr:0x401632a0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0x40018000, 90288) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
sk@sk:~/tmp$ cat /etc/debian_version
3.1
sk@sk:~/tmp$ uname -a
Linux localhost 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 GNU/Linux
sk@sk:~/tmp$

sk@sk:~/tmp$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-8)
sk@sk:~/tmp$

free_serj ★★
() автор топика
Ответ на: комментарий от archont

Так и поступил, просто интересно, из-за чего проблема была.

free_serj ★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.