llvm-ar writing huge empty file?

52 views
Skip to first unread message

Lee Morgan

unread,
Dec 19, 2014, 6:41:14 AM12/19/14
to emscripte...@googlegroups.com
Hi

llvm-ar appears to be writing a huge and empty file when trying to build a library.

strace reports thousands of 4k writes of blank strings and I can zip the eventual output from 8Gb to 8Mb. 

Does anyone know why this could be?

Thanks!

(on ubuntu 14.4)
./emsdk list

The following individual tools exist:
           clang-incoming-32bit     
           clang-incoming-64bit     
           clang-master-32bit       INSTALLED
    (*)    clang-master-64bit       INSTALLED
           emscripten-1.25.0         INSTALLED
           emscripten-1.27.0        
           emscripten-incoming      
    (*)    emscripten-master         INSTALLED


The following Emscripten SDK versions are available:
         sdk-incoming-32bit       
         sdk-incoming-64bit       
         sdk-master-32bit         INSTALLED
    *    sdk-master-64bit         INSTALLED

Items marked with * are activated for the current user.
Items marked with (*) are selected for use, but your current shell environment is not configured to use them. Type "source ./emsdk_env.sh" to set up your current shell to use them, or call "emsdk activate --global <name_of_sdk>" to permanently activate them.

To access the historical archived versions, type 'emsdk list --old'

Alon Zakai

unread,
Dec 19, 2014, 3:06:48 PM12/19/14
to emscripte...@googlegroups.com
That sounds strange. The output library is bigger than the input files, and contains lots of empty space? Is it functional otherwise though?

Do you have a testcase that shows the problem?

- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jukka Jylänki

unread,
Dec 19, 2014, 3:41:23 PM12/19/14
to emscripte...@googlegroups.com
By any chance, are you running under VirtualBox or other virtual VM? I remember some years ago running into an issue where a program would try to write to a shared directory tree under VirtualBox, and replacing writes turned into appending writes, causing innocent small writes to get amplified to several gigs. If so, does that happen if running outside a virtualized environment?

That's just a long shot, but your description reminded me of that issue I had.

Lee Morgan

unread,
Jan 5, 2015, 10:58:16 AM1/5/15
to emscripte...@googlegroups.com
Thanks I'm not using a VM.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Lee Morgan

unread,
Jan 5, 2015, 11:15:42 AM1/5/15
to emscripte...@googlegroups.com
Actually I've found it happens with the freetype test case 'python tests/runner.py test_freetype' as this invokes the linker.

Again it quickly creates an 8gb file and writes empty strings. If left running it will eventually start appending - I haven't left it long enough to finish - although the appending makes me suspect it will just fill the disk.

I last tried with sdk-master-64bit but the incoming sdk has the same behaviour. I've left settings.js alone assuming 'emsdk install xxx' will overwrite it from the repo so it should be sensible defaults.

The /tmp where the temporary library file is created is on a partition with 12G free space.

I'm stumped on what would cause it though.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Lee Morgan

unread,
Jan 8, 2015, 7:53:06 AM1/8/15
to emscripte...@googlegroups.com
Ok I found it - .a archive files only have 6 digits for user Ids and lvm-ar.cpp isnt properly checking for overflow causing huge padding characters to be written.

I generated a pull request although I don't know why this hasn't been a problem for someone before now.

Thanks.

b...@dropbox.com

unread,
Jan 28, 2015, 10:50:08 PM1/28/15
to emscripte...@googlegroups.com
I'm experiencing the same problem on 1.29, 528KB object file in 8GB+ file out. Where is the pull request you mentioned?

b...@dropbox.com

unread,
Jan 28, 2015, 11:01:44 PM1/28/15
to emscripte...@googlegroups.com

Lee Morgan

unread,
Jan 29, 2015, 2:39:10 AM1/29/15
to emscripte...@googlegroups.com

There was a fix in llvm but that's not made it to emscripten latest yet. However it is in the incoming sdk so try that toolset.

I closed the pull request fix as it's already on its way.

You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/xlXYS1o59w4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages