Jump to content

Recommended Posts

[root@aomori root]# ls
anaconda-ks.cfg  install.log  install.log.syslog  nohup.out  oracleNotes.txt
[root@aomori root]# rm nohup.out
rm: détruire fichier régulier `nohup.out'? y
Erreur de segmentation
[root@aomori root]# rm nohup.out
rm: détruire fichier régulier `nohup.out'? o
Erreur de segmentation

J'obtiens ça sur une Red Hat Enterprise Linux 3 fraichement installée

:censored:

Link to comment
Share on other sites

La taille du fichier n'y est pour rien:

[root@aomori root]# ls -l
total 64
-rw-r--r--    1 root     root         1021 avr 26 10:59 anaconda-ks.cfg
-rw-r--r--    1 root     root        43477 avr 26 10:58 install.log
-rw-r--r--    1 root     root         6036 avr 26 10:58 install.log.syslog
-rw-------    1 root     root           73 mai  3 12:54 nohup.out
-rw-r--r--    1 root     root         1766 avr 26 16:42 oracleNotes.txt
[root@aomori root]# touch foo
[root@aomori root]# rm foo
rm: détruire fichier régulier vide `foo'? y
Erreur de segmentation

PS: Avec l'option -f ça passe

Link to comment
Share on other sites

J'ai remarqué que ça ne plante qu'avec l'option -i (demande de confimation)

[root@aomori root]# which rm
alias rm='rm -i'
       /bin/rm

si l'option -i n'est pas utilisée (ou utilisée avec -f) le fichier est effacé et l'exection se termine correctement

Voici le résultat de strace:

[root@aomori root]# strace /bin/rm -i foo
execve("/bin/rm", ["/bin/rm", "-i", "foo"], [/* 36 vars */]) = 0
uname({sys="Linux", node="aomori.datus.fr", ...}) = 0
brk(0)                                  = 0x804f788
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=76185, ...}) = 0
old_mmap(NULL, 76185, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb75d8000
close(3)                                = 0
open("/lib/tls/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\0000X\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1563240, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75d7000
old_mmap(NULL, 1272460, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb74a0000
old_mmap(0xb75d1000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xb75d1000
old_mmap(0xb75d4000, 10892, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb75d4000
close(3)                                = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb75d7780, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xb75d8000, 76185)               = 0
brk(0)                                  = 0x804f788
brk(0x8070788)                          = 0x8070788
brk(0)                                  = 0x8070788
brk(0x8071000)                          = 0x8071000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=32140784, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb72a0000
close(3)                                = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
lstat64("foo", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
access("foo", W_OK)                     = 0
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2601, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb729f000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2601
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb729f000, 4096)                = 0
open("/usr/share/locale/fr_FR.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr_FR.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr_FR/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=247247, ...}) = 0
mmap2(NULL, 247247, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7263000
close(3)                                = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=21436, ...}) = 0
mmap2(NULL, 21436, PROT_READ, MAP_SHARED, 3, 0) = 0xb725d000
close(3)                                = 0
open("/usr/lib/gconv/ISO8859-1.so", 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\20\6\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=5524, ...}) = 0
old_mmap(NULL, 4364, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb725b000
old_mmap(0xb725c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0xb725c000
close(3)                                = 0
open("foo", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
write(2, "/bin/rm: d\303\251truire fichier r\303\251gu"..., 49/bin/rm: détruire fichier régulier vide `foo'? ) = 49
fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb725a000
read(0, y
"y\n", 1024)                    = 2
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

et celui de gdb:

[root@aomori root]# gdb /bin/rm
GNU gdb Red Hat Linux (5.3.90-0.20030710.40rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -i foo
Starting program: /bin/rm -i foo
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found).../bin/rm: détruire fichier régulier vide `foo'? y

Program received signal SIGSEGV, Segmentation fault.
0xb7658ebc in ?? ()

Link to comment
Share on other sites

ldd /bin/rm ?

md /bin/rm et tu compares avec une autre RHES3 ?

Voici le résultat de ldd et ld:

[root@aomori root]# ldd /bin/rm
       libc.so.6 => /lib/tls/libc.so.6 (0xb74a0000)
       /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)
[root@aomori root]# ld /bin/rm
ld: AVERTISSEMENT: ne peut trouver le symbole d'entrée _start; utilise par défaut 08048eb0

Si quelqu'un dispose de la même distrib...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...