Bug 70538
Summary: | r/w incompatibility between glibc-2.2.90 and 2.2.5 | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Public Beta | Reporter: | Olivier Baudron <olivier.baudron> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | limbo | CC: | fweimer, tspinillo, wtogami | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2002-08-10 11:47:56 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: | |||||||
Bug Blocks: | 67218 | ||||||
Attachments: |
|
Description
Olivier Baudron
2002-08-02 12:26:30 UTC
Created attachment 68444 [details]
testcase in C (58 lines)
Yes, I know about this very well. The above testcase really is triggering undefined behaviour, but from what I saw on mutt it does what is required, ie. an fflush call in between. Roland just checked in a fix for this, http://sources.redhat.com/ml/libc-hacker/2002-08/msg00006.html I'll give it some testing later today. fflush() does not help... I changed my testcase as shown below and I still have the same error in fgets(). --- test.c 2002-08-02 15:05:01 +0200 +++ test.c 2002-08-02 15:00:30 +0200 @@ -44,6 +44,9 @@ /* Try to read appended data */ + rc = fflush (fp); + check_rc (rc != 0, "fflush()"); + rc = fseek (fp, end, SEEK_SET); check_rc (rc != 0, "fseek()"); Well, from a standards point of view it matters. That glibc until now did not do this properly for mmap stdio is a bug. Obviously, fragments of the file are mapped all over the place ;) In the present state, it cannot work. open("/tmp/foo", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 mmap2(NULL, 6, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40013000 ^^^^^^^ ^^^^^^^^^^ stat64("/tmp/foo", {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 open("/tmp/foo", O_WRONLY|O_APPEND|O_CREAT, 0666) = 4 fstat64(4, {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 mmap2(NULL,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0)=0x40014000 ^^^^^^^^^^ fstat64(4, {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 _llseek(4, 6, [6], SEEK_SET) = 0 ^^^^^^^^^^^^^^^^ write(4, "...appended data...\n", 20) = 20 ^^^^^^^^^^^^^^^^^^^^^ close(4) = 0 munmap(0x40014000, 4096) = 0 From libc/libio/bug-mmap-fflush.c (Roland McGrath 07/31): if (strncmp (buffer, "From ", 5) != 0) abort (); At least, now I am sure... I am not the only one to have mailbox problems ;) And yes, this is stol^H^H^H^Hborrowed from mutt! ;) Current glibc cvs works for me. Hope this will be backport soon to rawhide. Fixed in -21. Thanks. |