Apache OpenOffice (AOO) Bugzilla – Issue 104535
Unnecessary access() system calls in the file selection dialog
Last modified: 2017-05-20 11:33:16 UTC
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.
certainly a good idea
Reset assigne to the default "issues@openoffice.apache.org".