bug-fileutils
[Top][All Lists]
Advanced

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

"mkdir a ab; mv a ab ab" causes segfault


From: Adam Sampson
Subject: "mkdir a ab; mv a ab ab" causes segfault
Date: Tue, 13 Mar 2001 18:16:29 +0000
User-agent: Mutt/1.2.5i

Hiya. I've just upgraded my fileutils to 4.0 (using the stock source from
ftp.gnu.org), and noticed what appears to be a minor bug. I'm using glibc
2.2.2, gcc 2.95.2, and Linux 2.4.2-ac18. A friend has reproduced this on a
Redhat 6.2 system.

While experimenting with config files, I did "mkdir .sawfish_old; mv
.sawfish* .sawfish_old" and got a segfault; with a bit of experimentation I
reduced this to "mkdir a ab; mv a ab ab" to consistently produce a segfault:

(azz:~/src/fileutils-4.0/src) mkdir a ab
(azz:~/src/fileutils-4.0/src) gdb /bin/mv
GNU gdb 4.17
Copyright 1998 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 "i586-pc-linux-gnu"...
(gdb) run a ab ab
Starting program: /bin/mv a ab ab
/bin/mv:
Program received signal SIGSEGV, Segmentation fault.
0x4007f399 in _IO_vfprintf () at _i18n_number.h:49
_i18n_number.h:49: No such file or directory.
(gdb) where
#0  0x4007f399 in _IO_vfprintf () at _i18n_number.h:49
#1  0x40082379 in buffered_vfprintf (s=0x4013d180,
    format=0x804f280 "%s: won't create hard link %s' to directory %s'",
    args=0xbfffeed8) at vfprintf.c:2087
#2  0x4007d9ff in _IO_vfprintf () at _i18n_number.h:49
#3  0x400fcebe in __error (status=0, errnum=0,
    message=0x804f280 "%s: won't create hard link %s' to directory %s'")
    at error.c:153
#4  0x804ac85 in copy_internal (src_path=0x8051de0 "ab/a",
    dst_path=0x8051df0 "ab/ab/a", new_dst=1, device=5698,
    ancestors=0xbffff12c, x=0xbffff428, move_mode=0,
    copy_into_self=0xbffff100, rename_succeeded=0x0) at copy.c:606
#5  0x8049fd3 in copy_dir (src_path_in=0xbffff667 "ab",
    dst_path_in=0x80516a8 "ab/ab", new_dst=1, src_sb=0xbffff294,
    ancestors=0xbffff12c, x=0xbffff428, copy_into_self=0xbffff384)
    at copy.c:139
#6  0x804aeb8 in copy_internal (src_path=0xbffff667 "ab",
    dst_path=0x80516a8 "ab/ab", new_dst=1, device=0, ancestors=0x0,
    x=0xbffff428, move_mode=1, copy_into_self=0xbffff384,
    rename_succeeded=0xbffff388) at copy.c:679
#7  0x804b7d7 in copy (src_path=0xbffff667 "ab", dst_path=0x80516a8 "ab/ab",
    nonexistent_dst=0, options=0xbffff428, copy_into_self=0xbffff384,
    rename_succeeded=0xbffff388) at copy.c:936
---Type <return> to continue, or q <return> to quit---
#8  0x8049631 in do_move (source=0xbffff667 "ab", dest=0x80516a8 "ab/ab",
    x=0xbffff428) at mv.c:180
#9  0x80498d0 in movefile (source=0xbffff667 "ab", dest=0xbffff66a "ab",
    dest_is_dir=1, x=0xbffff428) at mv.c:310
#10 0x8049ddb in main (argc=4, argv=0xbffff4ec) at mv.c:449
#11 0x4004c243 in Letext () at ../sysdeps/generic/libc-start.c:130
(gdb) frame 4
#4  0x804ac85 in copy_internal (src_path=0x8051de0 "ab/a",
    dst_path=0x8051df0 "ab/ab/a", new_dst=1, device=5698,
    ancestors=0xbffff12c, x=0xbffff428, move_mode=0,
    copy_into_self=0xbffff100, rename_succeeded=0x0) at copy.c:606
606               error (0, 0, _("%s: won't create hard link %s' to
directory %s'"),
(gdb) list
601           /* Avoid damaging the destination filesystem by refusing to
preserve
602              hard-linked directories (which are found at least in Netapp
snapshot
603              directories).  */
604           if (S_ISDIR (src_type))
605             {
606               error (0, 0, _("%s: won't create hard link %s' to
directory %s'"),
607                      dst_path, earlier_file);
608               goto un_backup;
609             }
610   
(gdb) print dst_path
$1 = 0x8051df0 "ab/ab/a"
(gdb) print earlier_file
$2 = 0x80516a8 "ab/ab"

Thanks,

-- 

Adam Sampson
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]