Your message dated Tue, 15 Oct 2024 23:53:15 +0200
with message-id
<CA+6XHwRWgOzrsQPKE4=nfchjpxd14gustq1swpi3qjd7j0z...@mail.gmail.com>
and subject line Re: Should open output file with O_APPEND
has caused the Debian Bug report #528488,
regarding Should open output file with O_APPEND
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
528488: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528488
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
X-Reportbug-Version: 4.2
X-Debbugs-Cc: [email protected]
Package: strace
Version: 4.5.18-1
Severity: normal
I'm sometimes using strace to debug long-running processes, by looking into
the log files from time to time.
When they grow, I'd like to truncate them, so that effectively a new logfile
(for the same process) is started.
But that doesn't really work, because strace opens the output file without
O_APPEND:
# strace -e open strace -o /tmp/log true
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/dev/urandom", O_RDONLY) = 3
open("/tmp/log", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
So when I truncate the logfile, the file position is the same, and everything
before the next write is filled with \0.
As for all log files the correct way would be to use O_APPEND (at least IMO).
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.29-1-amd64 (SMP w/1 CPU core)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages strace depends on:
ii libc6 2.9-12 GNU C Library: Shared libraries
strace recommends no packages.
strace suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Version: 4.26-0.1
On Sat, 21 Mar 2020 02:42:15 +0100 Eugene Syromiatnikov <[email protected]> wrote:
>
> This has been fixed in strace 4.22 by addition of the -A option
> (commit be55c1c61aec).
--- End Message ---