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

Bug#27066: funny close



First, sorry I missed your mails because of a configuration botch.  You can
safely reply to this message.

Second, sorry for the confusing data is my original report.

As for the bug, however, I can duplicate it without my preloaded library.

I originally noticed the problem on my laptop, which was and still is
running an older potato snapshot with dpkg version 1.4.1.1.  In this case, I
get an attempt to close an enormous file descriptor (1073933412 in the
strace below).  However, the number is not entirely deterministic, although
it does not usually change from one run to the next.  I have not tracked
down a pattern to how it changes.

On another machine running current potato with dpkg 1.4.1.6, I still get an
EBADF close, but the number is small (55 in the strace below).  I also have
not gotten any other numbers in my brief experiment.  This machine is
entirely more powerful than the laptop, if that could have anything to do
with it.

I may get a chance to upgrade my laptop to get another data point.

Both strace's below are generated by the command

strace -o trace dpkg-deb --fsys-tarfile pcmcia-modules-2.0.35_3.0.0-9+custom.1.0_i386.deb > out

(I did not trace through forks this time, as the error occurs in the parent;
this is why the trace is so much shorter.)

The .deb is one that I compiled using the pcmcia-source package; I can send
it to you if you'd like.  You can find the offending line in the strace's by
searching for EBADF.

Thanks for your replies,
Andrew

On my laptop (dpkg 1.4.1.1):

execve("/usr/bin/dpkg-deb", ["dpkg-deb", "--fsys-tarfile", "pcmcia-modules-2.0.35_3.0.0-9+custom.1.0_i386.deb"], [/* 17 vars */]) = 0
brk(0)                                  = 0x8053344
open("/etc/ld.so.preload", O_RDONLY)    = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
mmap(0, 42, PROT_READ|PROT_WRITE, MAP_PRIVATE, 4, 0) = 0x40015000
close(4)                                = 0
munmap(0x40015000, 42)                  = 0
open("/etc/ld.so.cache", O_RDONLY)      = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=6758, ...}) = 0
mmap(0, 6758, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40015000
close(4)                                = 0
open("/usr/lib/libdpkg.so.0", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=50308, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 83236, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40017000
mprotect(0x40023000, 34084, PROT_NONE)  = 0
mmap(0x40023000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xb000) = 0x40023000
mmap(0x40024000, 29988, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40024000
close(4)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=1170636, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 994172, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4002c000
mprotect(0x40117000, 31612, PROT_NONE)  = 0
mmap(0x40117000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xea000) = 0x40117000
mmap(0x4011c000, 11132, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4011c000
close(4)                                = 0
mprotect(0x4002c000, 962560, PROT_READ|PROT_WRITE) = 0
mprotect(0x4002c000, 962560, PROT_READ|PROT_EXEC) = 0
munmap(0x40015000, 6758)                = 0
personality(PER_LINUX)                  = 0
getpid()                                = 408
brk(0)                                  = 0x8053344
brk(0x80534e4)                          = 0x80534e4
brk(0x8054000)                          = 0x8054000
open("pcmcia-modules-2.0.35_3.0.0-9+custom.1.0_i386.deb", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=113090, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=113090, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
read(4, "!<arch>\ndebian-binary   9034805"..., 4096) = 4096
_llseek(4, -2354, {1742}, SEEK_CUR)     = 0
pipe([5, 6])                            = 0
fork()                                  = 409
close(6)                                = 0
fork()                                  = 410
close(5)                                = 0
close(1073933412)                       = -1 EBADF (Bad file descriptor)
wait4(410, 0xbffffb1c, 0, NULL)         = ? ERESTARTSYS (To be restarted)
--- SIGCHLD (Child exited) ---
wait4(410, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 410
--- SIGCHLD (Child exited) ---
wait4(409, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 409
_exit(0)                                = ?

On my desktop (dpkg 1.4.1.6):

execve("/usr/bin/dpkg-deb", ["dpkg-deb", "--fsys-tarfile", "pcmcia-modules-2.0.35_3.0.0-9+custom.1.0_i386.deb"], [/* 28 vars */]) = 0
brk(0)                                  = 0x8051668
open("/etc/ld.so.preload", O_RDONLY)    = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=26, ...}) = 0
mmap(NULL, 26, PROT_READ|PROT_WRITE, MAP_PRIVATE, 4, 0) = 0x40013000
close(4)                                = 0
munmap(0x40013000, 26)                  = 0
open("/etc/ld.so.cache", O_RDONLY)      = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=14960, ...}) = 0
mmap(NULL, 14960, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40013000
close(4)                                = 0
open("/usr/lib/libdpkg.so.0", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=54184, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P)\0\000"..., 4096) = 4096
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
mmap(NULL, 86324, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40018000
mprotect(0x40025000, 33076, PROT_NONE)  = 0
mmap(0x40025000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xc000) = 0x40025000
mmap(0x40026000, 28980, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40026000
close(4)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=1017135, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\204\203"..., 4096) = 4096
mmap(NULL, 899516, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4002e000
mprotect(0x40102000, 31164, PROT_NONE)  = 0
mmap(0x40102000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xd3000) = 0x40102000
mmap(0x40107000, 10684, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40107000
close(4)                                = 0
munmap(0x40013000, 14960)               = 0
personality(PER_LINUX)                  = 0
getpid()                                = 12105
brk(0)                                  = 0x8051668
brk(0x8051808)                          = 0x8051808
brk(0x8052000)                          = 0x8052000
open("pcmcia-modules-2.0.35_3.0.0-9+custom.1.0_i386.deb", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=113090, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=113090, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000
read(4, "!<arch>\ndebian-binary   90348052"..., 4096) = 4096
_llseek(4, -2354, [1742], SEEK_CUR)     = 0
_llseek(4, 0, [0], SEEK_SET)            = 0
read(4, "!<arch>\ndebian-binary   90348052"..., 1742) = 1742
pipe([5, 6])                            = 0
fork()                                  = 12106
close(6)                                = 0
fork()                                  = 12107
close(5)                                = 0
close(55)                               = -1 EBADF (Bad file descriptor)
wait4(12107, 0xbffff7dc, 0, NULL)       = ? ERESTARTSYS (To be restarted)
--- SIGCHLD (Child exited) ---
wait4(12107, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 12107
--- SIGCHLD (Child exited) ---
wait4(12106, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 12106
_exit(0)                                = ?


Reply to: