Bug 241309
Summary: | huge empty file created after an ungetwc() followed by fwide() | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Martin Sebor <sebor> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 4.4 | CC: | drepper, fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2007-05-30 14:31:40 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: | |||||||
Attachments: |
|
Description
Martin Sebor
2007-05-24 23:50:55 UTC
Created attachment 155405 [details]
Output of strace ./a.out >/dev/null 2>/dev/pts/1
This testcase violates ISO C99, 7.19.2(5): "wide character input/output functions shall not be applied to a byte-oriented stream." puts is a byte output function, therefore the stream after puts is byte-oriented. ungetwc is wide input/output function and thus must not be used until you reorient the stream. I suspected the program was invalid but didn't look carefully enough for where the standard says so. Thanks for taking the time to provide the reference! Even though the program is not valid I thought you might like to know about this type of behavior and consider making a change. I note that Enterprise Linux 5 creates a file of 0 size so it looks like the change may have already been implemented. Why should we slow all correctly built programs to accomodate an invalid program? |