From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 385273858D28; Mon, 11 Dec 2023 12:58:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 385273858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702299522; bh=X16cBlQXbD+BOotQkh2hnIFMBoT4K/k7okRAk03bVHI=; h=From:To:Subject:Date:From; b=vcoZMith13+lNZ6NFasng+fetMz2lMpPl2BPZ/NPLCWgaONIERU/puPGbQ/H2jjrg X0JYaYd4Bo4RgSDgI7YpUtM4LbKzstVL7spUMXBRMSwtm9+rf/D/LXSg52sX8N8UUe /QPYWpMQcQZhnt4j9hjKfWr7xm3R5LLvH9KdUqaw= From: "david.marchand at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug stdio/31137] New: Regression vfprintf + setbuf (no buffering) Date: Mon, 11 Dec 2023 12:58:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: stdio X-Bugzilla-Version: 2.37 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: david.marchand at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31137 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=3D15252&action=3Ded= it log.c For the context, OVS has its logging framework (which writes to file, conso= le, 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/00= 3/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 =3D=3D=3D=3D=3D=3D=3D=3D=3D Calling fprintf idx=3D0 size=3D511 Calling vfprintf idx=3D0 size=3D511 setbuf _IONBF =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Calling fprintf idx=3D0 size=3D511 Calling vfprintf idx=3D0 size=3D511 # From a f38 container: [root@3fbf304e6894 ~]# gcc -o log -Wall -Werror log.c; ./log no setbuf =3D=3D=3D=3D=3D=3D=3D=3D=3D Calling fprintf idx=3D0 size=3D511 Calling vfprintf idx=3D0 size=3D511 setbuf _IONBF =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Calling fprintf idx=3D0 size=3D511 Calling vfprintf idx=3D0 size=3D128 idx=3D1 size=3D128 idx=3D2 size=3D128 idx=3D3 size=3D127 --=20 You are receiving this mail because: You are on the CC list for the bug.=