Bug 14713 - Missing call to msync in Output_file::unmap()
Summary: Missing call to msync in Output_file::unmap()
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-12 11:18 UTC by Daniel Meister
Modified: 2012-12-02 20:59 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch implementing the proposed solution by calling ::msync before ::munmap (460 bytes, patch)
2012-12-02 20:59 UTC, Daniel Meister
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Meister 2012-10-12 11:18:39 UTC
We see an error when linking with GNU gold and writing the output file to an NFS location hosted on a ZFS file system.

If needed I can provide more details on the software/OS versions involved.

This issue could be resolved with the function Output_file::unmap() in output.cc doing a call to ::msync before calling ::munmap.
Comment 1 Daniel Meister 2012-10-12 11:55:35 UTC
And of course the detailed description of the error is missing.

The output file (executable) is available on the server (and the other NFS clients) but it is just a file with the correct size filled with NUL-bytes.

The problem is reproducible using a simple test program using mmap/munmap and disappears as soon as there is a msync inserted before the munmap.
Comment 2 Daniel Meister 2012-10-12 12:01:33 UTC
Please also see the following entry from the NFS FAQ:
http://nfs.sourceforge.net/#faq_d8
Comment 3 Daniel Meister 2012-12-02 20:59:10 UTC
Created attachment 6769 [details]
patch implementing the proposed solution by calling ::msync before ::munmap