To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=89730
Issue #|89730
Summary|osl_getAbsoluteFileURL() lstat()s too much
Component|porting
Version|DEV300m12
Platform|All
URL|
OS/Version|All
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|PATCH
Priority|P3
Subcomponent|code
Assigned to|mh
Reported by|kendy
------- Additional comments from [EMAIL PROTECTED] Wed May 21 13:58:48 +0000
2008 -------
The implementation of osl_getAbsoluteFileURL_impl_() is done so that it
lstat()s O(n^2), instead of n paths (where n is depth of the path). It is
because it calls realpath() on each of the components of the path, and
realpath() itself does lstat() on each of the components itself. I'll attach
a patch that changes it to lstat()ing n paths only - on the price of _not_
absolutizing non-existing paths. To me, it seems like a good deal ;-) - if
the path does not exist, who cares what part of it is absolute? In the case
it was created later, nobody can expect what part of that path were symlinks
etc. anyway, and it should go through the full realpath() process anyway.
Here's a part of strace log showing the wrong behavior:
10406 19:41:49.765833 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.765887 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.765936 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.765993 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766042 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766092 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766153 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766202 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766251 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766303
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
10406 19:41:49.766363 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766412 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766461 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766514
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
10406 19:41:49.766568
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766628 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766677 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766726 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766779
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
10406 19:41:49.766833
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766887
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure/bin",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.766949 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766997 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.767047 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.767099
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
10406 19:41:49.767153
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.767208
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure/lib",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
The patch changes it to simple:
10406 19:41:49.766949 lstat("/local", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.766997 lstat("/local/inst", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
10406 19:41:49.767047 lstat("/local/inst/OpenOffice.org3.0-m12",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.767099
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
10406 19:41:49.767153
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
10406 19:41:49.767208
lstat("/local/inst/OpenOffice.org3.0-m12/openoffice.org/ure/lib",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]