bugfindutils - Bugs: bug #16520, find is not finding certain...

 
 

bug #16520: find is not finding certain strangely named files

Submitted by:  Alexander Skwar <askwar>
Submitted on:  Thu 04 May 2006 06:21:36 AM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 15 Jun 2006 07:58:57 AM UTC, comment #8:

James Youngman wrote:

> I would guess that the byte sequence in the filename does not
> correspond with a valid sequence of bytes in the character
> encoding systenm you have configured for your environment


I am pretty sure that was the cause, see http://bugs.debian.org/cgi-bin/372499 which contains a example filetree.

> If so, the likely reason is that fnmatch() is failing to decode
> the (invalid) byte sequence according to the character encoding
> that has been specified.


It would be nice if <invalid seqquence>.jpg matched the pattern *.jpg. bash and even dash seem to manage this:

UTF-8 locale set in test:
$ find -name 'gamixmp3'
$ LC_ALL=C find -name 'gamixmp3'
./dance/m?gamix.mp3
./dance/m?gamix.mp3
$ ls -d dance/gamixmp3
dance/m?gamix.mp3 dance/m?gamix.mp3

cu andreas

Andreas Metzler <ametzler>
Thu 15 Jun 2006 06:10:28 AM UTC, comment #7:

I cannot reproduce my bug anymore. As I wrote in comment #5, when I now do a

find -name "*jpg"

in a directory containing nothing but the file from the tar from <http://bugs.gentoo.org/attachment.cgi?id=86117>, "find" finds the file just fine.

alexander@blatt ~/tmp/16520 $ ls -laR
.:
insgesamt 8
drwxr-xr-x 3 alexander users 44 15. Jun 08:06 .
drwxr-xr-x 5 alexander users 4096 15. Jun 08:06 ..
drwxr-xr-x 2 alexander users 119 15. Jun 08:06 02) Krankenhaus Klinikum-Barmen

./02) Krankenhaus Klinikum-Barmen:
insgesamt 904
drwxr-xr-x 2 alexander users 119 15. Jun 08:06 .
drwxr-xr-x 3 alexander users 44 15. Jun 08:06 ..
-rw-r--r-- 1 alexander users 922538 6. Nov 2005 [2005-04-14 20-17-09] (0766) Sandra mit Cassandra auf Arm, Klinikum Barmen, Tag 23 - Schwarz-Wei?:009f.jpg

alexander@blatt ~/tmp/16520 $ find . -name "*jpg"
./02) Krankenhaus Klinikum-Barmen/[2005-04-14 20-17-09] (0766) Sandra mit Cassandra auf Arm, Klinikum Barmen, Tag 23 - Schwarz-Wei?:009f.jpg

alexander@blatt ~/tmp/16520 $ find --version
GNU find Version 4.3.0
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS

Because of that, I'd like to suggest to close the bug - WFM, Works For Me.

Alexander Skwar <askwar>
Wed 14 Jun 2006 09:11:41 PM UTC, comment #6:

I would guess that the byte sequence in the filename does not correspond with a valid sequence of bytes in the character encoding systenm you have configured for your environment (which I am guessing is UTF-8).

If you do "LC_ALL=C find ......." does it then work? If so, the likely reason is that fnmatch() is failing to decode the (invalid) byte sequence according to the character encoding that has been specified. But this is just a guess. Could you make this test and let us know the result?

Thanks.

James Youngman <jay>
Project AdministratorIn charge of this item.
Thu 04 May 2006 07:41:03 PM UTC, comment #5:

I now recompiled findutils 4.3.0, and now find is behaving correctly - ie. a find . -name "*jpg" is also finding those strangely named files.

Alexander Skwar <askwar>
Thu 04 May 2006 06:30:00 AM UTC, comment #4:

Please disregard file #9888. It contains nothing. Have a look at this attachment instead.

Alexander Skwar <askwar>
Thu 04 May 2006 06:28:20 AM UTC, comment #3:

Attached, you can find:

alexander@blatt /dev/shm/02 $ strace -o/tmp/find_bad.strace.txt find . -name "766"
alexander@blatt /dev/shm/02 $

Alexander Skwar <askwar>
Thu 04 May 2006 06:27:28 AM UTC, comment #2:

Attached, you can find the output of:

alexander@blatt /dev/shm/02 $ strace -o/tmp/find_good.strace.txt find . -name "dateie"
./dateien.txt
alexander@blatt /dev/shm/02 $

Alexander Skwar <askwar>
Thu 04 May 2006 06:25:51 AM UTC, comment #1:

On the Gentoo bugzilla, you can find a tar file containing this strangely named file. See: http://bugs.gentoo.org/attachment.cgi?id=86117

Alexander Skwar <askwar>
Thu 04 May 2006 06:21:36 AM UTC, original submission:

On my Gentoo Linux system, I'm using find version 4.3.0 and have problems, finding certan strangely named files. For example, in a local directory on a tmpfs, I've got:

alexander@blatt /dev/shm/02 $ ls -la
insgesamt 916
drwxr-xr-x 2 alexander users 80 4. May 08:03 .
drwxrwxrwt 3 root root 80 4. May 07:59 ..
-rw-r--r-- 1 alexander users 922538 6. Nov 16:00 [2005-04-14 20-17-09] (0766) Sandra mit Cassandra auf Arm, Klinikum Barmen, Tag 23 - Schwarz-Wei�:009f.jpg
-rw-r--r-- 1 alexander users 125 4. May 08:03 dateien.txt

Now I'm trying to find the jpg file with find:

alexander@blatt /dev/shm/02 $ find . -name "*jpg"
alexander@blatt /dev/shm/02 $

As you see, NOTHING is found.

I suppose, this is because of the following characters:

�:009f

Instead of "�:009f", it should be a simple "ß", so it should read "Schwarz-Weiß".

alexander@blatt /dev/shm/02 $ find . -fprint dateien.txt ; hexdump -C dateien.txt | grep jpg
00000070 65 69 c3 3a 30 30 39 66 2e 6a 70 67 0a |ei.:009f.jpg.|

As you can see here, the � is a 0x3c character.

Now, my question is - why is find not finding the file?

All of this is NOT happening on a non-Gentoo system with find 4.1.20.

I also reported this bug to Gentoo. See bug report at http://bugs.gentoo.org/show_bug.cgi?id=132206

Alexander Skwar <askwar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #9889:  find_bad.strace.txt added by askwar (7KiB - text/plain - Good version of "strace -o/tmp/find_bad.strace.txt find . -name "766"")
file #9887:  find_good.strace.txt added by askwar (7KiB - text/plain - strace -o/tmp/find_good.strace.txt find . -name "dateie")

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 15 Jun 2006 08:02:47 AM UTCjayStatusNone=>Works For Me
  Assigned toNone=>jay
  Open/ClosedOpen=>Closed
Thu 04 May 2006 06:30:00 AM UTCaskwarAttached File-=>Added find_bad.strace.txt, #9889
Thu 04 May 2006 06:28:20 AM UTCaskwarAttached File-=>Added find_bad.strace.txt, #9888
Thu 04 May 2006 06:27:28 AM UTCaskwarAttached File-=>Added find_good.strace.txt, #9887

Back to the top


Powered by Savane 3.1-cleanup1