#2642 closed bug (fixed)
bfs: mkdir creates invalid directory
Reported by: | emitrax | Owned by: | nobody |
---|---|---|---|
Priority: | low | Milestone: | R1/beta2 |
Component: | System/POSIX | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Sorry, I couldn't find a better summary
for i in `seq -w 1 1000` ; do mkdir $i ; cd $i ; done
By running the above in bash, you'll see that onced reached the absolute deepth of 204 levels, the script continues to create directory in the last level, but it is unable to cd'in, and returns an error of "no such file or directory".
While not critical, it shouldn't create invalid directory.
Change History (9)
follow-up: 2 comment:1 by , 16 years ago
comment:2 by , 16 years ago
Replying to axeld:
This sounds very much like you get beyond B_PATH_NAME_LENGTH; it will cut the path after 1024 bytes, and therefore isn't able to create the directory with the name you intended.
If so, it should be handled differently, as in linux I get an path name too long or alike.
What exactly happens? Have you tried to manually enter the deepest level to see how it looks like?
Yes I did. I get a no such file or directory.
Actually, now that I think of, it shoulnd't be the B_PATH_NAME_LENGHT, because I always use the relative path, not the absolute. With the script, I create the directory and cd'in right away, then create another one, cd'in and so on. Thus the name is at most always 4 bytes.
comment:3 by , 14 years ago
Running this on hrev38581 I get this now about 204 levels deep:
cd: error retrieving current directory: getcwd: cannot access parent directories: Range Error
And "cd .." gives the same error message.
comment:4 by , 10 years ago
Component: | - General → System/POSIX |
---|
There is still the error message scott gets, but there is no actual limitation now. It's just bash and cd getting lost at what the current directory is. You can check in tracker (with some patience) that the 1000 nested dirs were created just fine.
I tested the same on Linux and there is no such error (I interrupted the script after it created about 650 levels).
So there may be a problem in either bash or getcwd, but not in BFS.
comment:5 by , 10 years ago
As I mentioned before, the B_PATH_NAME_LENGTH
limit is likely to come into play at some point (for example, while trying to get the pwd for the prompt). It might be larger on your Linux test installation, anyway.
The error from getcwd also hints in that direction.
comment:6 by , 8 years ago
Owner: | changed from | to
---|---|
Priority: | normal → low |
Status: | new → assigned |
comment:7 by , 6 years ago
Milestone: | R1 → Unscheduled |
---|
comment:9 by , 5 years ago
Milestone: | Unscheduled → R1/beta2 |
---|
Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone
This sounds very much like you get beyond B_PATH_NAME_LENGTH; it will cut the path after 1024 bytes, and therefore isn't able to create the directory with the name you intended.
What exactly happens? Have you tried to manually enter the deepest level to see how it looks like?