To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=104535
                 Issue #|104535
                 Summary|Unnecessary access() system calls in the file selectio
                        |n dialog
               Component|framework
                 Version|DEV300m48
                Platform|All
                     URL|
              OS/Version|Unix, X11
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|ENHANCEMENT
                Priority|P3
            Subcomponent|code
             Assigned to|tm
             Reported by|tora





------- Additional comments from t...@openoffice.org Thu Aug 27 03:51:14 +0000 
2009 -------
Steps:
 1. /opt/openoffice.org3/program/soffice &
 2. truss -d -t access,openat -p `pgrep soffice.bin` (on Solaris)
    strace -t -f -e trace=access,open -p `pgrep soffice.bin` (on Linux)
 3. File - Open
 4. Type / t m p in the File name text field of the file selection dialog.

Results (on Solaris):
Thread#  Elapse SystemCall                                      ReturnValue
/92:     8.2615 access("/", F_OK)                               = 0
/92:     8.2617 access("/", F_OK)                               = 0
/92:     8.2618 openat(AT_FDCWD, "/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 25
/92:     8.2633 access("/usr/bin", F_OK)                        = 0
/92:     8.2634 access("/usr/bin", F_OK)                        = 0
/93:    10.7576 access("/t", F_OK)                              Err#2 ENOENT
/93:    10.7577 access("/t", F_OK)                              Err#2 ENOENT
/93:    10.7580 access("/", F_OK)                               = 0
/93:    10.7582 openat(AT_FDCWD, "/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 25
/93:    10.7596 access("/usr/bin", F_OK)                        = 0
/93:    10.7597 access("/usr/bin", F_OK)                        = 0
/94:    13.3891 access("/tm", F_OK)                             Err#2 ENOENT
/94:    13.3892 access("/tm", F_OK)                             Err#2 ENOENT
/94:    13.3895 access("/", F_OK)                               = 0
/94:    13.3896 openat(AT_FDCWD, "/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 25
/94:    13.3908 access("/usr/bin", F_OK)                        = 0
/94:    13.3908 access("/usr/bin", F_OK)                        = 0
/95:    16.5656 access("/tmp", F_OK)                            = 0
/95:    16.5658 access("/", F_OK)                               = 0
/95:    16.5659 openat(AT_FDCWD, "/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 25
/95:    16.5674 access("/usr/bin", F_OK)                        = 0
/95:    16.5675 access("/usr/bin", F_OK)                        = 0

Every time as a user types a letter, soffice.bin creates a new thread and the 
thread calls access() system calls.

Thread#  Elapse SystemCall                                      ReturnValue
/92:     8.2615 access("/", F_OK)                               = 0
/93:    10.7576 access("/t", F_OK)                              Err#2 ENOENT
/94:    13.3891 access("/tm", F_OK)                             Err#2 ENOENT
/95:    16.5656 access("/tmp", F_OK)                            = 0

That leads a problem described in the issue 92644.


In contrast, some UNIX commands such as bash and tcsh also be capable of file 
name completion as soffice.bin similarly offers. They, however, do not use 
access() system calls, but just use openat() for opendir() user level function.

$ tcsh
> tty
/dev/pts/54

$ ps -t pts/54
   PID TTY         TIME CMD
14164 pts/54      0:00 tcsh
12910 pts/54      0:00 bash

$ truss -d -t access,openat -p 14164
Base time stamp:  1251342975.1725  [ Thu Aug 27 12:16:15 JST 2009 ]
 4.4109 openat(AT_FDCWD, "/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 3
 7.7308 openat(AT_FDCWD, "/tmp/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 3
10.6669 openat(AT_FDCWD, "/tmp/", O_RDONLY|O_NDELAY|O_LARGEFILE) = 3


soffice.bin could replace some code fragments related to thread creations and 
access() invocations for a file selection dialog with much simpler codes.

---------------------------------------------------------------------
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: issues-unsubscr...@framework.openoffice.org
For additional commands, e-mail: issues-h...@framework.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to