bug-coreutils
[Top][All Lists]
Advanced

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

Re: dd bug


From: Buciuman Adrian
Subject: Re: dd bug
Date: Sun, 12 Oct 2003 19:50:54 +0200

----- Original Message -----
From: Andreas Schwab <address@hidden>
To: Paul Eggert <address@hidden>
Cc: <address@hidden>; Buciuman Adrian <address@hidden>
Sent: Wednesday, September 24, 2003 11:16 PM
Subject: Re: dd bug


> Paul Eggert <address@hidden> writes:
>
> > Buciuman Adrian <address@hidden> writes:
> >
> >> read(0, "1                               "..., 737280) = 36864
> >> write(1, "1                               "..., 737280) = 737280
> >> read(0, 0x4015a000, 737280)             = -1 EIO (Input/output error)
> >
> > Apparently the first "read" found the I/O error, and decided to return
> > the bytes that it found.  The second "read" then reported the I/O error.
> > I didn't expect this pattern; I thought the first "read" would fail.
>
> That would mean that the kernel would need to discard what it already
> sucessfully read, with no way to recover the data (it can't put it back
> either).  There is no way to both return some data and report an error
> with the same read call.
>
> Andreas.
>


 I ' ve tested ( on Linux ) the last patch provided by Paul Eggert . The
problem is still present , however there is a significant change

The resulting file is different.


With dd 5.0.91 :            sectors 1-72 from the floppy , (1368+1440) * 512
bytes of null padding ,
sectors 1513 - 2880 from the floppy ,  72 * 512 bytes
of null padding.


With the patch applied :  sectors 1-72 from the floppy , (1368+1440) * 512
bytes of null padding ,
sectors 1441 - 2880 from the floppy .

( sector 73 was bad )

Therefore there is still 1 block of null paddding in excess.



execve("/usr/local/bin/dd", ["dd", "if=/dev/fd0", "of=/root/teste/1",
"conv=sync,noerror", "bs=720k"], [/* 29 vars */]) = 0
brk(0)                                  = 0x804e790
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=62731, ...}) = 0
old_mmap(NULL, 62731, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40015000
close(3)                                = 0
open("/lib/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\0p\\\1\000"..., 1024)
= 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1435624, ...}) = 0
old_mmap(NULL, 1256740, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40025000
mprotect(0x4014f000, 36132, PROT_NONE)  = 0
old_mmap(0x4014f000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x12a000) = 0x4014f000
old_mmap(0x40154000, 15652, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40154000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40158000
munmap(0x40015000, 62731)               = 0
brk(0)                                  = 0x804e790
brk(0x804f790)                          = 0x804f790
brk(0x8050000)                          = 0x8050000
close(0)                                = 0
open("/dev/fd0", O_RDONLY|O_LARGEFILE)  = 0
_llseek(0, 0, [0], SEEK_CUR)            = 0
close(1)                                = 0
open("/root/teste/1", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 1
rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {0x804922c, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {0x804922c, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGPIPE, {0x804922c, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x8049280, [], 0x4000000}, NULL, 8) = 0
old_mmap(NULL, 749568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40159000
read(0, "1                               "..., 737280) = 36864
write(1, "1                               "..., 737280) = 737280
read(0, 0x4015a000, 737280)             = -1 EIO (Input/output error)
write(2, "dd: ", 4)                     = 4
write(2, "reading `/dev/fd0\'", 18)     = 18
write(2, ": Input/output error", 20)    = 20
write(2, "\n", 1)                       = 1
write(2, "0+1 records in\n", 15)        = 15
write(2, "1+0 records out\n", 16)       = 16
_llseek(0, 0, [36864], SEEK_CUR)        = 0
ioctl(0, SNDCTL_MIDI_MPUCMD, 0xbffff7c0) = -1 EINVAL (Invalid argument)
_llseek(0, 700416, [737280], SEEK_CUR)  = 0
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
737280) = 737280
read(0, "1441                            "..., 737280) = 737280
write(1, "1441                            "..., 737280) = 737280
read(0, "", 737280)                     = 0
munmap(0x40159000, 749568)              = 0
write(2, "1+2 records in\n", 15)        = 15
write(2, "3+0 records out\n", 16)       = 16
close(0)                                = 0
close(1)                                = 0
semget(IPC_PRIVATE, 0, 0)               = -1 ENOSYS (Function not
implemented)
_exit(0)                                = ?








reply via email to

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