2000-11-09 15:21:27

by Andrea Pintori

[permalink] [raw]
Subject: Kernel 2.2.17 bug found

I've a Debian dist, Kernel 2.2.17, no patches, all packages are stable.

here what I found:

[/tmp] mkdir old
[/tmp] chdir old
[/tmp/old] mv . ../new
[/tmp/old] (should be /tmp/new !!)
[/tmp/old] mkdir fff
error: cannot write...
[tmp/old] ls > fff
error: cannot write...
[/tmp/old] ls -la
total 0 (?)
[/tmp/old] cd ..
[/tmp] ls -la
***************** ./
***************** ../
***************** new/

Does anybody knew this bug?


2000-11-09 15:43:42

by Tim Waugh

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found

On Thu, Nov 09, 2000 at 05:20:22PM +0200, Andrea Pintori wrote:

> [/tmp/old] mv . ../new
> [/tmp/old] (should be /tmp/new !!)

You forgot to 'cd .'

Tim.
*/


Attachments:
(No filename) (177.00 B)
(No filename) (232.00 B)
Download all attachments

2000-11-09 15:48:21

by Michael Rothwell

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found

Tim Waugh wrote:

> You forgot to 'cd .'

Look for "pebsak" messages in /var/log/syslog

;)

2000-11-09 15:52:02

by Thomas K?hler

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found

On Thu, Nov 09, 2000 at 05:20:22PM +0200,
Andrea Pintori <[email protected]> wrote:
>
> I've a Debian dist, Kernel 2.2.17, no patches, all packages are stable.

I've Debian unstable, Kernel 2.2.17

> here what I found:
>
> [/tmp] mkdir old
> [/tmp] chdir old
> [/tmp/old] mv . ../new
> [/tmp/old] (should be /tmp/new !!)

Uhm, no. $PWD only gets updated on cd, not on mv. Thus, the old value is
OK!

> [/tmp/old] mkdir fff
> error: cannot write...
> [tmp/old] ls > fff
> error: cannot write...

This seems wrong. But I'd rather say this is a bug in your shell, not in
the kernel!

/tmp> mkdir old
/tmp> cd old
/tmp/old> mv . ../new
/tmp/old> mkdir fff
/tmp/old> ls -al
total 12
drwxr-xr-x 3 jean-luc jean-luc 4096 Nov 9 16:46 .
drwxrwxrwt 8 root root 4096 Nov 9 16:46 ..
drwxr-xr-x 2 jean-luc jean-luc 4096 Nov 9 16:46 fff
/tmp/old> cd ../new
/tmp/new> ls -al
total 12
drwxr-xr-x 3 jean-luc jean-luc 4096 Nov 9 16:46 .
drwxrwxrwt 8 root root 4096 Nov 9 16:46 ..
drwxr-xr-x 2 jean-luc jean-luc 4096 Nov 9 16:46 fff

Works for both bash-2.04 and zsh-3.1.9-dev7 (as in Debian unstable).

> Does anybody knew this bug?

Well, I can't even reproduce it ;)

Ciao,
Thomas

--
Thomas K?hler Email: [email protected] | LCARS - Linux
<>< WWW: http://jeanluc-picard.de | for Computers
IRC: jeanluc | on All Real
PGP public key available from Homepage! | Starships


Attachments:
(No filename) (1.51 kB)
(No filename) (232.00 B)
Download all attachments

2000-11-09 16:01:23

by Richard B. Johnson

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found

On Thu, 9 Nov 2000, Andrea Pintori wrote:

> I've a Debian dist, Kernel 2.2.17, no patches, all packages are stable.
>
> here what I found:
>
> [/tmp] mkdir old
> [/tmp] chdir old
> [/tmp/old] mv . ../new
> [/tmp/old] (should be /tmp/new !!)

The shell might not read this all the while so the name you see
may not change until you change directory.

> [/tmp/old] mkdir fff
> error: cannot write...

This should not happen and it doesn't happen in kernel version 2.4.0-test0

> [tmp/old] ls > fff
> error: cannot write...
> [/tmp/old] ls -la
> total 0 (?)
> [/tmp/old] cd ..
> [/tmp] ls -la
> ***************** ./
> ***************** ../
> ***************** new/
>


Script started on Thu Nov 9 10:45:35 2000
# pwd
/tmp
# mkdir old
# cd old
# pwd
/tmp/old
# mv ../old ../new
# pwd
/tmp/old The shell hasn't re-read the current directory
# ls
# >foo Make a file called foo
# ls
foo It's there okay
# rm foo Remove the file
# mkdir bar Make a directory
# ls
bar It's there
# cd bar
# pwd
/tmp/new/bar Now, the shell re-read the directory, it is correct
# cd ..
# pwd
/tmp/new Back where we were, shell reads correct directory.
# cd ..
# ls
new typescript
# rm -r new
# exit
exit

Script done on Thu Nov 9 10:47:23 2000



Cheers,
Dick Johnson

Penguin : Linux version 2.4.0 on an i686 machine (799.54 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


2000-11-09 16:03:43

by Jesse Pollard

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found

On Thu, Nov 09, 2000 at 05:20:22PM +0200, Andrea Pintori wrote:
> I've a Debian dist, Kernel 2.2.17, no patches, all packages are stable.
>
> here what I found:
>
> [/tmp] mkdir old
> [/tmp] chdir old
> [/tmp/old] mv . ../new
> [/tmp/old] (should be /tmp/new !!)
> [/tmp/old] mkdir fff
> error: cannot write...
> [tmp/old] ls > fff
> error: cannot write...
> [/tmp/old] ls -la
> total 0 (?)
> [/tmp/old] cd ..
> [/tmp] ls -la
> ***************** ./
> ***************** ../
> ***************** new/
>
> Does anybody knew this bug?

Not a bug... possibly a typo though. The "[/tmp/old] mv . ../new" line
destroys the definition of "current directory". The "mkdir fff" can't work
since the current directory is no longer there, and is indicated by
the lines:
[/tmp/old] ls -la
total 0 (?)

There is nothing to take a directory of.
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.

2000-11-09 22:56:21

by J.A. Magallon

[permalink] [raw]
Subject: Re: Kernel 2.2.17 bug found


On Thu, 09 Nov 2000 16:20:22 Andrea Pintori wrote:
> I've a Debian dist, Kernel 2.2.17, no patches, all packages are stable.
>
> here what I found:
>
> [/tmp] mkdir old
> [/tmp] chdir old
> [/tmp/old] mv . ../new
> [/tmp/old] (should be /tmp/new !!)

No, bash cwd is still "/tmp/old".

> [/tmp/old] mkdir fff
> error: cannot write...
> [tmp/old] ls > fff
> error: cannot write...
> [/tmp/old] ls -la
> total 0 (?)

Right, "/tmp/old" does not exist, so nothing can be done with it.

> [/tmp/old] cd ..
> [/tmp] ls -la
> ***************** ./
> ***************** ../
> ***************** new/
>
> Does anybody knew this bug?

Is not a bug, I have also seen that int SGI IRIX. Try it in an NFS mounted
disk. I don't remember exactly, but even you can ls it. Things on file
system caches and so on...

--
Juan Antonio Magallon Lacarta #> cd /pub
mailto:[email protected] #> more beer