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

 
 

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

Submitter:  Alexander Skwar <askwar>
Submitted:  Thu 04 May 2006 06:21:36 AM UTC
   
 
Category:  find Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Works For Me Privacy:  Public
Assigned to:  jay Originator Name: 
Open/Closed:  Closed Release:  None
Fixed Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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.debia ... rg/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 '*gamix*mp3'
$ LC_ALL=C find -name '*gamix*mp3'
./dance/m?gamix.mp3
./dance/m?gamix.mp3
$ ls -d dance/*gamix*mp3
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.gento ... ment.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>
Group administrator
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.gento ... ment.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.gento ... bug.cgi?id=132206

Alexander Skwar <askwar>

 

Attached Files

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

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

History

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-06-15 jay StatusNone Works For Me
    Assigned toNone jay
    Open/ClosedOpen Closed
2006-05-04 askwar Attached File- Added find_bad.strace.txt, #9889
2006-05-04 askwar Attached File- Added find_bad.strace.txt, #9888
2006-05-04 askwar Attached File- Added find_good.strace.txt, #9887

Back to the top

Powered by Savane 3.16.
Corresponding source code