Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

"File truncated" error from ar when attempting to create V<my_block>__ALL.a ?!

Added by David Banas 2 months ago

I'm getting the following error at the end of an otherwise successful translation/compilation:

ar: creating V<my_block>__ALL.a
ar: V<my_block>__ALL.a: File truncated

It's a large project and I have a 40-core machine at my disposal. So, I'm using:

export VM_DEFAULT_RULES   = 1
export VM_PARALLEL_BUILDS = 1

in my top-level makefile. This results in 197 fast, and 61 slow, *.cpp files and associated object files. Is it the large number of files being targeted for archival that is causing the truncation error? Has anyone else bumped into this?

Sorry, just realized it's not the options above that are responsible for the large number of files; it's these:

--output-split 20000
--output-split-cfuncs 50000

Replies (4)

RE: "File truncated" error from ar when attempting to create V<my_block>__ALL.a ?! - Added by Wilson Snyder 2 months ago

You're probably on a network disk (NFS) and a compile has exited but hasn't finished flushing the .o to disk when the ar tries to read it. This is a well known flaw in how NFS works.

The easiest is a "sleep 30" or so before your ar command.

If you're compiling on a single machine, using a local disk should help, then copy the output to your NFS disk. Of course if you're doing a real distcc job across a farm that won't help.

Here'd one of many more complicated solutions https://unix.stackexchange.com/questions/23408/is-there-a-command-which-will-force-linux-to-flush-cache-of-one-file-on-an-nfs-s

RE: "File truncated" error from ar when attempting to create V<my_block>__ALL.a ?! - Added by David Banas 2 months ago

Hmm, I just tried rebuilding the archive again (It's been a couple hours since the compilation finished.) and got the same error.

RE: "File truncated" error from ar when attempting to create V<my_block>__ALL.a ?! - Added by Wilson Snyder 2 months ago

In that case likely one of the objects got truncated by gcc, perhaps you missed an error?

You should be able to e.g. try the ar with one input file at a time to find which object is corrupt, then delete that .o and recompile it. If you are lucky just do a ls and see if one .o is zero size.

RE: "File truncated" error from ar when attempting to create V<my_block>__ALL.a ?! - Added by David Banas 2 months ago

Aha! I just tried building up the archive file by hand and noticed that it starts failing (giving the "File truncated" error) when the archive file reaches 4.1 Gbytes in size. Is this a hard limit for ar, or am I just missing an option to allow it to build past this limit?

    (1-4/4)