Bug 14713

Summary: Missing call to msync in Output_file::unmap()
Product: binutils Reporter: Daniel Meister <daniel>
Component: goldAssignee: Ian Lance Taylor <ian>
Status: NEW ---    
Severity: normal CC: ccoutant
Priority: P2    
Version: 2.24   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: patch implementing the proposed solution by calling ::msync before ::munmap

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