public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/31137] New: Regression vfprintf + setbuf (no buffering)
@ 2023-12-11 12:58 david.marchand at redhat dot com
  2023-12-11 13:00 ` [Bug stdio/31137] " fweimer at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: david.marchand at redhat dot com @ 2023-12-11 12:58 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31137

            Bug ID: 31137
           Summary: Regression vfprintf + setbuf (no buffering)
           Product: glibc
           Version: 2.37
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: david.marchand at redhat dot com
  Target Milestone: ---

Created attachment 15252
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15252&action=edit
log.c

For the context, OVS has its logging framework (which writes to file, console,
syslog etc...). DPDK is a library for networking datapath in userspace, and its
components generate log messages through its own framework. DPDK provides a way
to redirect those logs by passing a FILE * from fopencookie.
OVS does this and disables buffering.

After updating from f37 to f38 (glibc-2.36-17.fc37.x86_64 to
glibc-2.37-13.fc38.x86_64), I noticed a change in how the logs are written for
dpdk messages in OVS.

Example of output:
2023-11-17T12:50:38.137Z|00059|dpdk|INFO|VHOST_CONFIG:
(/home/dmarchan/git/pub/ovs/master/build/tests/system-dpdk-testsuite.dir/003/dpdkvhostclient0)
Linear buffers requ
2023-11-17T12:50:38.137Z|00060|dpdk|INFO|ested without external buffers,

The log message has been split in 128 bytes chunks (if I count correctly).

I attached a simple reproducer (to mimick what is done in OVS, which
takes over DPDK logs with a similar fopencookie + setbuf in non
buffering mode).

# From a f37 container:
[root@cb7d749e838f ~]# gcc -o log -Wall -Werror log.c; ./log
no setbuf
=========

Calling fprintf
idx=0 size=511

Calling vfprintf
idx=0 size=511


setbuf _IONBF
=============

Calling fprintf
idx=0 size=511

Calling vfprintf
idx=0 size=511


# From a f38 container:
[root@3fbf304e6894 ~]# gcc -o log -Wall -Werror log.c; ./log
no setbuf
=========

Calling fprintf
idx=0 size=511

Calling vfprintf
idx=0 size=511


setbuf _IONBF
=============

Calling fprintf
idx=0 size=511

Calling vfprintf
idx=0 size=128
idx=1 size=128
idx=2 size=128
idx=3 size=127

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-16 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 12:58 [Bug stdio/31137] New: Regression vfprintf + setbuf (no buffering) david.marchand at redhat dot com
2023-12-11 13:00 ` [Bug stdio/31137] " fweimer at redhat dot com
2023-12-11 13:32 ` schwab@linux-m68k.org
2023-12-11 13:48 ` fweimer at redhat dot com
2023-12-11 15:04 ` schwab@linux-m68k.org
2023-12-11 17:37 ` fweimer at redhat dot com
2024-04-16 17:21 ` carlos at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).