This issue was originally reported against Fedora24 strace (bug #1377846) and RHEL-7.3 (bug #1377847), and it is now reproducible against devtoolset-8-strace-4.23-3.el7. It was fixed upstream on https://github.com/strace/strace/commit/212a444bdc24cdc22622987a515197e69ad2a83f +++ This bug was initially created as a clone of Bug #1377846 +++ I get this: open("/tmp", O_RDWR|O_EXCL|O_DIRECTORY|O_TMPFILE) = 3 openat(AT_FDCWD, "/tmp", O_RDWR|O_EXCL|O_DIRECTORY|O_TMPFILE) = 3 O_TMPFILE reqires the mode argument (just like O_CREAT), so strace should show it as well. Seen with strace-4.13-1.fc24.x86_64.
The problem is that O_TMPFILE/__O_TMPFILE is not available in the version of the kernel-headers package present in devtoolset-8.0-rhel-7-build[1], so it's not entirely similar to bz#1377846 and bz#1377847. The possible workaround is to adopt [2], which, unfortunately, not yet in master, but probably will be there at some point. So far, I've made a scratch build[3] that produces the following output: $ scl enable devtoolset-8 -- strace -P '/tmp' ./prog open("/tmp", O_WRONLY|__O_TMPFILE|O_DIRECTORY, 0700) = 3 +++ exited with 0 +++ Not sure yet, however, how to handle the whole O_TMPFILE definition weirdness better. [1] See http://download.eng.bos.redhat.com/brewroot/packages/devtoolset-8-strace/4.23/3.el7/data/logs/x86_64/root.log , kernel-headers=3.10.0-514.53.1.el7 [2] https://github.com/strace/strace/commit/0ea08f500ba9d02704d1626d105ac7cef5e3dc8c , a patch that provides fallback values for open mode flags on all architectures supported by strace. [3] https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17471729
The issue has been fixed upstream[1][2][3]. [1] https://gitlab.com/strace/strace/commit/c20a515b6d88 [2] https://gitlab.com/strace/strace/commit/a6ab0251f0a5 [3] https://gitlab.com/strace/strace/commit/11e24ca2a4c1
Thanks for the fix, Eugene. devtoolset-8-strace-4.23-5.el7 now identifies O_TMPFILE. However, when comparing open/openat tracing output with strace-4.12-9.el7 on rhel-alt-7.5 aarch64, it still looks slightly different, with devtoolset-8-strace not showing O_DIRECTORY flag: [root@apm-mustang-b0-12 ~]# scl enable devtoolset-8 -- strace -P '/tmp' ./prog openat(AT_FDCWD, "/tmp", O_WRONLY|O_TMPFILE, 0700) = 3 +++ exited with 0 +++ [root@apm-mustang-b0-12 ~]# rpm -qa devtoolset-8-strace devtoolset-8-strace-4.23-5.el7.aarch64 [root@apm-mustang-b0-12 ~]# strace -P '/tmp' ./prog openat(AT_FDCWD, "/tmp", O_WRONLY|O_DIRECTORY|O_TMPFILE, 0700) = 3 +++ exited with 0 +++ [root@apm-mustang-b0-12 ~]# rpm -qa strace strace-4.12-9.el7.aarch64 While in ppc64le, devtoolset-8-strace does list O_DIRECTORY: [root@ibm-p9z-16-lp4 ~]# scl enable devtoolset-8 -- strace -P '/tmp' ./prog open("/tmp", O_WRONLY|__O_TMPFILE|O_DIRECTORY, 0700) = 3 +++ exited with 0 +++ [root@ibm-p9z-16-lp4 ~]# rpm -qa devtoolset-8-strace devtoolset-8-strace-4.23-5.el7.ppc64le [root@ibm-p9z-16-lp4 ~]# strace -P '/tmp' ./prog open("/tmp", O_WRONLY|O_DIRECTORY|O_TMPFILE, 0700) = 3 +++ exited with 0 +++ [root@ibm-p9z-16-lp4 ~]# rpm -qa strace strace-4.12-9.el7.ppc64le Is this expected?
(In reply to Edjunior Barbosa Machado from comment #8) > Is this expected? Sort of. Upstream strace contains[1] a fallback definition for __O_TMPFILE (as provided by kernel), but not for O_TMPFILE, as it has a history of various definitions by various libcs. aarch64 buildroot and ppc64le buildroot contain different versions of the kernel-headers package: the former has kernel-headers-4.5.0-15.4.2.el7.aarch64[2], and the latter has kernel-headers-3.10.0-514.53.1.el7.ppc64le[3]; the former provides O_TMPFILE definition and the latter don't. A RHEL-only patch that provides O_TMPFILE fallback definition can be added, if it will create less confusion. [1] https://gitlab.com/strace/strace/blob/v4.24/xlat/open_mode_flags.in#L173 [2] http://download.eng.bos.redhat.com/brewroot/packages/devtoolset-8-strace/4.23/5.el7/data/logs/aarch64/root.log [3] http://download.eng.bos.redhat.com/brewroot/packages/devtoolset-8-strace/4.23/5.el7/data/logs/ppc64le/root.log
devtoolset-8-strace-4.24-3.el7 has a RHEL-only patch that introduces O_TMPFILE fallback definition.
Thanks Eugene, but for some reason devtoolset-8-strace-4.24-4.el7 in RHEL-ALT-7.5 (verified in aarch64 and s390x) is not yet showing O_DIRECTORY flag on open() syscall: [root@ibm-z-76 bz1377847-strace-Mode-not-shown-for-O-TMPFILE]# rpm -qa devtoolset-8-strace devtoolset-8-strace-4.24-4.el7.s390x [root@ibm-z-76 bz1377847-strace-Mode-not-shown-for-O-TMPFILE]# scl enable devtoolset-8 -- strace -P /tmp ./prog open("/tmp", O_WRONLY|O_TMPFILE, 0700) = 3 +++ exited with 0 +++ Comparing to rhel-7.5 strace: [root@ibm-z-76 bz1377847-strace-Mode-not-shown-for-O-TMPFILE]# rpm -qa strace strace-4.12-6.el7.s390x [root@ibm-z-76 bz1377847-strace-Mode-not-shown-for-O-TMPFILE]# strace -P /tmp ./prog open("/tmp", O_WRONLY|O_DIRECTORY|O_TMPFILE, 0700) = 3 +++ exited with 0 +++ [root@ibm-z-76 bz1377847-strace-Mode-not-shown-for-O-TMPFILE]# uname -r 4.14.0-49.el7a.s390x
That's because O_TMPFILE value is obtained from /usr/include/asm-generic/fcntl.h, where it's defined as (__O_TMPFILE | O_DIRECTORY). I think that it should be consistent with RHEL 7 behaviour since 4.24-3, as the fallback definition is the same[1]. [1] http://pkgs.devel.redhat.com/cgit/rpms/strace/commit/?h=devtoolset-8.0-rhel-7&id=6a846ffaa2f1dc59448920db4c59224ecdb26630
Thanks again Eugene for clarifying that. Verified that now, with devtoolset-8-strace-4.24-4.el7, all arches have consistent output following O_TMPFILE fallback definition on both rhel and rhel-alt.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:3573