You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2020/10/20 19:05:39 UTC

[Bug 64834] New: Sporadic file truncation or excessive NULL bytes at the end

https://bz.apache.org/bugzilla/show_bug.cgi?id=64834

            Bug ID: 64834
           Summary: Sporadic file truncation or excessive NULL bytes at
                    the end
           Product: Apache httpd-2
           Version: 2.4.41
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: mmd.osm@gmail.com
  Target Milestone: ---

OpenStreetMap publishes a replication status file under
https://planet.openstreetmap.org/replication/minute/state.txt, which is served
as static content and gets updated atomically on the filesystem every minute.
File sizes might vary slightly from minute to minute, e.g. 158 bytes, 168
bytes.

Consumers reading from that file have reported sporadic issues, like truncated
files, or files with excessive NULL bytes towards the end.

Our observations have shown that although the file gets updated atomically on
the file system, Apache serves the _new_ state.txt file contents using the
_old_ state.txt file length. This way, some response might lack the last 10
Bytes, or there's an additional 10 NULL bytes towards the end.

We're suspecting that there might be some race condition, where checking the
file size and processing the actual file contents might see different versions
of that file.

Is is a valid use case to change a minutely changing file as static content? Is
this a bug or works-as-designed?

Downstream issue: https://github.com/openstreetmap/operations/issues/465

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 64834] Sporadic file truncation or excessive NULL bytes at the end

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64834

Joe Orton <jo...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Joe Orton <jo...@redhat.com> ---
Thanks, let's just track this in one place then.

*** This bug has been marked as a duplicate of bug 54962 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 64834] Sporadic file truncation or excessive NULL bytes at the end

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64834

--- Comment #3 from Christophe JAILLET <ch...@wanadoo.fr> ---
Also see bug 54962 which looks to be similar.
A patch is pending there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 64834] Sporadic file truncation or excessive NULL bytes at the end

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64834

--- Comment #2 from Joe Orton <jo...@redhat.com> ---
I think this is the race (e.g. bug 47693, I think there are more bugs on this)
between the stat() which is used to determine content-length and then opening
the file to send it.  It's a bug but it's designed in, fairly nasty really. 
Padding the file to a constant length would work around it.  Or somehow
ensuring the file is streamed as if it doesn't have a fixed C-L.  It would be a
very simple replacement for the default_handler which doesn't have this bug,
but not sure how to do it efficiently with the code as shipped.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 64834] Sporadic file truncation or excessive NULL bytes at the end

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64834

--- Comment #1 from Ruediger Pluem <rp...@apache.org> ---
Have you tried setting

EnableMMAP Off

http://httpd.apache.org/docs/2.4/mod/core.html#enablemmap

for the directory that contains the file?

<Directory /directory>
    EnableMMAP Off
</Directory>

or

<Location /replication/minute>
    EnableMMAP Off
</Location>

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org