Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1875597

Summary: fwrite on stream opened with open_memstream() truncates the buffer size
Product: Red Hat Enterprise Linux 7 Reporter: Paulo Andrade <pandrade>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.8CC: ashankar, codonell, dj, fweimer, glibc-bugzilla, mnewsome, pfrankli, qe-baseos-tools-bugs, sipoyare
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1875596 Environment:
Last Closed: 2020-09-11 14:27:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1875596    
Bug Blocks:    

Description Paulo Andrade 2020-09-03 20:35:22 UTC
+++ This bug was initially created as a clone of Bug #1875596 +++

Current output:

"""
Running test: fopen()
position after fwrite: 24
position after SEEK_END: 24

Running test: fmemopen()
position after fwrite: 24
position after SEEK_END: 24

Running test: open_memstream()
position after fwrite: 24
position after SEEK_END: 4

open_memstream() final buffer size: 4
"""

Expected ouput:
"""
Running test: fopen()
position after fwrite: 24
position after SEEK_END: 24

Running test: fmemopen()
position after fwrite: 24
position after SEEK_END: 24

Running test: open_memstream()
position after fwrite: 24
position after SEEK_END: 24

open_memstream() final buffer size: 24
"""

  The seek to the start of the buffer, and write data smaller than
the stream length truncates the memory stream.

Comment 2 Carlos O'Donell 2020-09-11 14:27:07 UTC
Red Hat Enterprise Linux 7 has entered Maintenance Support 2 and as such we will not be fixing this issue in RHEL 7. The behaviour is not a regression in RHEL 7. We will be tracking this issue upstream and reviewing the RHEL 8 situation (bug 1875596). Closing as CLOSED/WONTFIX.