[BUG] Search doesn't detect infinite loops
Posted: 2011-09-19, 22:53 UTC
I'm running 1.0 rc 1 on a Motorola Atrix 4G (Android 2.3.4). When searching from the file system root, the search is getting caught in an infinite loop caused by the "[face=courier]/osh/thumb2[/face] -> [face=courier]/osh[/face]" symlink. Since [face=courier]thumb2[/face] is a symlink to its own parent, the search will continue into [face=courier]/osh/thumb2[/face], [face=courier]/osh/thumb2/thumb2[/face], [face=courier]/osh/thumb2/thumb2/thumb2[/face], etc. The problem is described in the [face=courier]find(1)[/face] man page:
I believe the [face=courier]/osh[/face] directory is part of the Atrix Webtop feature, so this problem may be specific to the Atrix. It should be possible to reproduce the problem on other phones using the following steps:The POSIX standard requires that find detects loops:
The find utility shall detect infinite loops; that is, entering a previously visited directory that is an ancestor of the last file encountered. When it detects an infinite loop, find shall write a diagnostic message to standard error and shall either recover its position in the hierarchy or terminate.
- [face=courier]$ adb -d shell[/face]
- [face=courier]$ cd /tmp[/face]
- [face=courier]$ ln -s . loop[/face]
- Launch Total Commander and navigate to /tmp
- Search for "loop"