gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Re: tla get --hard-links available


From: Andrea Arcangeli
Subject: Re: [Gnu-arch-users] Re: tla get --hard-links available
Date: Fri, 3 Oct 2003 19:26:26 +0200
User-agent: Mutt/1.4.1i

On Fri, Oct 03, 2003 at 09:48:15AM -0700, Davide Libenzi wrote:
> On Fri, 3 Oct 2003, Andrea Arcangeli wrote:
> 
> > The archive is the real data, it sure doesn't need to know how fast we
> > generated it and in turn it doesn't need to have the hardlink option
> > inside it, like it doesn't have the mhz of my opteron stored inside.
> >
> > In the long run the kernel must start storing a bitflag in the on-disk
> > format of the inode for the kernel level copy-on-write functionality.
> 
> It's funny. I was going to ask you to propose this feature together, but
> then I thought that Al would have shot us :)
> 
> 
> 
> > For the short term fl-cow helps. BTW, I get segfaults with fl-cow in
> > 64bit mode, I guess it's not 64bit clean, or 64bit glibc hasn't been
> > tested well yet with LD_PRELOAD.
> 
> At load time or access time ? Any gdb dump ?

a bit random but normally way before the first printf. had no time to
debug this yet sorry ;) here some basic info

address@hidden:~/bin/x86_64/fl-cow/lib> ls -l
total 36
-rw-r--r--    1 andrea   andrea      12506 2003-10-03 10:34 libflcow.a
-rwxr-xr-x    1 andrea   andrea        728 2003-10-03 10:34 libflcow.la
-rwxr-xr-x    1 andrea   andrea      16217 2003-10-03 10:34 libflcow.so
address@hidden:~/bin/x86_64/fl-cow/lib> ps xa
Segmentation fault
address@hidden:~/bin/x86_64/fl-cow/lib> ls
libflcow.a  libflcow.la  libflcow.so
address@hidden:~/bin/x86_64/fl-cow/lib> ps
Segmentation fault
address@hidden:~/bin/x86_64/fl-cow/lib> strace ps
execve("/bin/ps", ["ps"], [/* 77 vars */]) = 0
uname({sys="Linux", node="velociraptor", ...}) = 0
brk(0)                                  = 0x40179190
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x2a95569000
open("/home/andrea/bin/x86_64/fl-cow/lib/libflcow.so", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\r\0"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=16217, ...}) = 0
mmap(NULL, 1054496, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a9566b000
mprotect(0x2a9566d000, 1046304, PROT_NONE) = 0
mmap(0x2a9576b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 
0x2a9576b000
close(3)                                = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/x86_64/libc.so.6", O_RDONLY) = 
-1 ENOENT (No such file or directory)
stat("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/x86_64", 0x7fbfffdf00) = -1 
ENOENT (No such file or directory)
open("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
stat("/home/andrea/bin/x86_64/gcc-3_3-branch/lib", 0x7fbfffdf00) = -1 ENOENT 
(No such file or directory)
open("/home/andrea/bin/x86_64/wine/lib/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT 
(No such file or directory)
stat("/home/andrea/bin/x86_64/wine/lib/x86_64", 0x7fbfffdf00) = -1 ENOENT (No 
such file or directory)
open("/home/andrea/bin/x86_64/wine/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
stat("/home/andrea/bin/x86_64/wine/lib", 0x7fbfffdf00) = -1 ENOENT (No such 
file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=81525, ...}) = 0
mmap(NULL, 81525, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a9556a000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\326"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=1518813, ...}) = 0
mmap(NULL, 2353160, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a9576d000
mprotect(0x2a9588f000, 1165320, PROT_NONE) = 0
mmap(0x2a9596d000, 241664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x100000) = 0x2a9596d000
mmap(0x2a959a8000, 14344, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2a959a8000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x2a9557e000
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \34\0\0"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=15610, ...}) = 0
mmap(NULL, 1058152, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a959ac000
mprotect(0x2a959ae000, 1049960, PROT_NONE) = 0
mmap(0x2a95aac000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 
0x2a95aac000
close(3)                                = 0
munmap(0x2a9556a000, 81525)             = 0
uname({sys="Linux", node="velociraptor", ...}) = 0
brk(0)                                  = 0x40179190
brk(0x4017a190)                         = 0x4017a190
brk(0)                                  = 0x4017a190
brk(0x4017b000)                         = 0x4017b000
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
address@hidden:~/bin/x86_64/fl-cow/lib> cat /proc/self/maps
Illegal instruction
address@hidden:~/bin/x86_64/fl-cow/lib> strace cat /proc/self/maps
execve("/bin/cat", ["cat", "/proc/self/maps"], [/* 77 vars */]) = 0
uname({sys="Linux", node="velociraptor", ...}) = 0
brk(0)                                  = 0x40104a70
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x2a95569000
open("/home/andrea/bin/x86_64/fl-cow/lib/libflcow.so", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\r\0"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=16217, ...}) = 0
mmap(NULL, 1054496, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a9566b000
mprotect(0x2a9566d000, 1046304, PROT_NONE) = 0
mmap(0x2a9576b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 
0x2a9576b000
close(3)                                = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/x86_64/libc.so.6", O_RDONLY) = 
-1 ENOENT (No such file or directory)
stat("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/x86_64", 0x7fbfffdef0) = -1 
ENOENT (No such file or directory)
open("/home/andrea/bin/x86_64/gcc-3_3-branch/lib/libc.so.6", O_RDONLY) = -1 
ENOENT (No such file or directory)
stat("/home/andrea/bin/x86_64/gcc-3_3-branch/lib", 0x7fbfffdef0) = -1 ENOENT 
(No such file or directory)
open("/home/andrea/bin/x86_64/wine/lib/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT 
(No such file or directory)
stat("/home/andrea/bin/x86_64/wine/lib/x86_64", 0x7fbfffdef0) = -1 ENOENT (No 
such file or directory)
open("/home/andrea/bin/x86_64/wine/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
stat("/home/andrea/bin/x86_64/wine/lib", 0x7fbfffdef0) = -1 ENOENT (No such 
file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=81525, ...}) = 0
mmap(NULL, 81525, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a9556a000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\326"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=1518813, ...}) = 0
mmap(NULL, 2353160, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a9576d000
mprotect(0x2a9588f000, 1165320, PROT_NONE) = 0
mmap(0x2a9596d000, 241664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x100000) = 0x2a9596d000
mmap(0x2a959a8000, 14344, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2a959a8000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x2a9557e000
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \34\0\0"..., 1024) = 
1024
fstat(3, {st_mode=S_IFREG|0755, st_size=15610, ...}) = 0
mmap(NULL, 1058152, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2a959ac000
mprotect(0x2a959ae000, 1049960, PROT_NONE) = 0
mmap(0x2a95aac000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 
0x2a95aac000
close(3)                                = 0
munmap(0x2a9556a000, 81525)             = 0
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=32058672, ...}) = 0
mmap(NULL, 32058672, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a95aaf000
close(3)                                = 0
brk(0)                                  = 0x40104a70
brk(0x40105a70)                         = 0x40105a70
brk(0)                                  = 0x40105a70
brk(0x40106000)                         = 0x40106000
fstat(1, {st_mode=S_IFCHR|0622, st_rdev=makedev(136, 5), ...}) = 0
mkdir("/proc/self/maps", 0)             = -1 EEXIST (File exists)
--- SIGILL (Illegal instruction) ---
+++ killed by SIGILL +++
address@hidden:~/bin/x86_64/fl-cow/lib> 

watch the above mkdir, that's totally broken, that's an _open_ w/o the
LD_PRELOAD set! Sounds very risky to enable it ;)

the IP where it crashes is this (provided by the kernel via `dmesg`, much
easier than gdb core dump ;):

ps[21959]: segfault at 0000000000000000 rip 0000002a9583563c rsp 
0000007fbfffe740 error 4
cat[21967] trap invalid operand rip:7fbfffeaba rsp:7fbfffe6a8 error:0

I attached the assembly of the library. By mixing the rip (equivalent of eip)
with the results of the mmap call and elf offsets, it's possible to find the C
code that crashed. But it takes too much time so I'm postponing this for next
week. If you want to go ahead you're welcome! ;)

Andrea - If you prefer relying on open source software, check these links:
            rsync.kernel.org::pub/scm/linux/kernel/bkcvs/linux-2.[45]/
            http://www.cobite.com/cvsps/

Attachment: x.bz2
Description: BZip2 compressed data


reply via email to

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