Bug 15660 - out of file descriptors and couldn't close any
Summary: out of file descriptors and couldn't close any
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-20 20:43 UTC by Martin Liška
Modified: 2015-02-12 09:24 UTC (History)
4 users (show)

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


Attachments
ld args and liblto plugin (145.99 KB, application/x-bzip)
2014-03-17 17:36 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2013-06-20 20:43:01 UTC
I've encountered similar bug to: http://sourceware.org/bugzilla/show_bug.cgi?id=10708 during linking of chromium binary.

ld --version
GNU gold (GNU Binutils 2.23.52.20130526) 1.11

Command line:
FAILED: flock linker.lock g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -pie -L. -flto=9 -fno-fat-lto-objects -O2 --param lto-partitions=64 -o chrome -Wl,--start-group obj/chrome/app/chrome.chrome_exe_main_gtk.o obj/chrome/app/chrome.chrome_main.o obj/chrome/app/chrome.chrome_main_delegate.o obj/chrome/libinstaller_util.a obj/media/libmedia_sse.a obj/third_party/icu/libicuuc.a obj/third_party/libjingle/libjingle.a obj/skia/libskia_opts.a obj/third_party/icu/libicudata.a obj/device/libdevice_media_transfer_protocol.a obj/native_client/src/trusted/service_runtime/arch/x86/libservice_runtime_x86_common.a obj/chrome/libservice.a obj/chrome/librenderer.a obj/webkit/support/libglue.a obj/content/libcontent_worker.a obj/third_party/libwebp/libwebp_utils.a obj/third_party/zlib/libminizip.a obj/chrome/browser/performance_monitor/libperformance_monitor.a obj/third_party/leveldatabase/libleveldatabase.a obj/native_client/src/trusted/service_runtime/libenv_cleanser.a obj/sandbox/libc_urandom_override.a obj/chrome/libbrowser.a obj/ppapi/libppapi_host.a obj/sync/libsync_core.a obj/gpu/libgles2_cmd_helper.a obj/third_party/smhasher/libcityhash.a obj/third_party/libphonenumber/libphonenumber.a obj/chrome/app/policy/libpolicy.a obj/webkit/support/libplugins_common.a obj/native_client/src/trusted/validator_x86/libnccopy_x86_64.a obj/webkit/support/libglue_common.a obj/webkit/renderer/compositor_bindings/libwebkit_compositor_support.a obj/third_party/smhasher/libmurmurhash3.a obj/content/libcontent_gpu.a obj/native_client/src/trusted/threading/libthread_interface.a obj/media/libmedia_mmx.a obj/ipc/libipc.a obj/third_party/libxslt/libxslt.a obj/remoting/libremoting_client.a obj/third_party/ots/libots.a obj/base/libsymbolize.a obj/native_client/src/trusted/validator/libvalidators.a obj/chrome/libbrowser_extensions.a obj/skia/libskia_opts_ssse3.a obj/third_party/protobuf/libprotobuf_lite.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_platform.a obj/ui/surface/libsurface.a obj/third_party/WebKit/Source/WebKit/chromium/libwebkit.a obj/native_client/src/trusted/validator/x86/64/libncvalidate_x86_64.a obj/third_party/jsoncpp/libjsoncpp.a obj/google_apis/libgoogle_apis.a obj/chrome/libnacl.a obj/third_party/libphonenumber/libphonenumber_without_metadata.a obj/chrome/libdebugger.a obj/v8/tools/gyp/libv8_snapshot.a obj/ui/native_theme/libnative_theme.a obj/third_party/libusb/libusb.a obj/content/libcontent_common_child.a obj/native_client/src/trusted/nacl_base/libnacl_base.a obj/base/libbase_static.a obj/native_client/src/shared/imc/libimc.a obj/chrome/libfeedback_proto.a obj/components/libbrowser_context_keyed_service.a obj/components/libweb_modal.a obj/chrome/libapps.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_platform_geometry.a obj/components/libuser_prefs.a obj/content/libcontent_utility.a obj/third_party/libevent/libevent.a obj/sandbox/libseccomp_bpf.a obj/build/linux/libpci.a obj/ui/gl/libgl_wrapper.a obj/third_party/mt19937ar/libmt19937ar.a obj/third_party/angle/src/libtranslator_common.a obj/ui/message_center/libmessage_center.a obj/third_party/libpng/libpng.a obj/components/libwebdata_common.a obj/third_party/opus/libopus.a obj/sync/libsync_notifier.a obj/ui/snapshot/libsnapshot.a obj/native_client/src/trusted/validator/x86/libncval_base_x86_64.a obj/webkit/support/libwebkit_media.a obj/third_party/libwebp/libwebp_dsp.a obj/third_party/harfbuzz-ng/libharfbuzz-ng.a obj/chrome/app/policy/libcloud_policy_proto_generated_compile.a obj/base/allocator/liballocator_extension_thunks.a obj/remoting/libremoting_jingle_glue.a obj/native_client/src/trusted/service_runtime/libnacl_error_code.a obj/third_party/snappy/libsnappy.a obj/cc/libcc.a obj/third_party/libjingle/libjingle_p2p_constants.a obj/third_party/cld/libcld.a obj/third_party/libxml/libxml2.a obj/webkit/support/libplugins.a obj/chrome/libvariations_seed_proto.a obj/remoting/proto/libchromotocol_proto_lib.a obj/native_client/src/trusted/simple_service/libsimple_service.a obj/chrome/libsync_file_system_proto.a obj/gpu/libdisk_cache_proto.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_html.a obj/native_client/src/trusted/interval_multiset/libnacl_interval.a obj/build/linux/libspeechd.a obj/sync/libsync_internal_api.a obj/third_party/hunspell/libhunspell.a obj/chrome/libplugin.a obj/ui/compositor/libcompositor.a obj/base/libbase_prefs.a obj/ui/web_dialogs/libweb_dialogs.a obj/native_client/src/trusted/desc/libdesc_wrapper.a obj/third_party/angle/src/libpreprocessor.a obj/gpu/libgpu_ipc.a obj/device/libdevice_usb.a obj/sandbox/libsuid_sandbox_client.a obj/tools/json_schema_compiler/libapi_gen_util.a obj/third_party/cacheinvalidation/libcacheinvalidation.a obj/webkit/support/libwebkit_base.a obj/remoting/libremoting_base.a obj/gpu/libcommand_buffer_client.a obj/gpu/libcommand_buffer_common.a obj/native_client/src/trusted/service_runtime/arch/x86_64/libservice_runtime_x86_64.a obj/third_party/libwebp/libwebp_enc.a obj/native_client/src/trusted/validator_ragel/libdfa_validate_x86_64.a obj/native_client/src/trusted/desc/libnrd_xfer.a obj/chrome/libcert_logger_proto.a obj/ppapi/libppapi_ipc.a obj/sdch/libsdch.a obj/third_party/angle/src/libtranslator_glsl.a obj/ppapi/libppapi_shared.a obj/gpu/libgles2_implementation.a obj/third_party/libXNVCtrl/libXNVCtrl.a obj/content/browser/speech/proto/libspeech_proto.a obj/build/temp_gyp/libgoogleurl.a obj/webkit/support/libuser_agent.a obj/net/libnet.a obj/media/libmedia_asm.a obj/base/libxdg_mime.a obj/chrome/libcloud_policy_proto.a obj/content/libcontent_browser.a obj/native_client/src/trusted/validator/libvalidation_cache.a obj/chrome/libbrowser_ui.a obj/chrome/libcommon_constants.a obj/base/third_party/dynamic_annotations/libdynamic_annotations.a obj/third_party/sfntly/libsfntly.a obj/ppapi/libppapi_cpp_objects.a obj/third_party/zlib/libzip.a obj/crypto/libcrcrypto.a obj/webkit/renderer/compositor_bindings/libwebkit_compositor_bindings.a obj/media/libshared_memory_support.a obj/third_party/undoview/libundoview.a obj/native_client/src/shared/gio/libgio.a obj/third_party/qcms/libqcms.a obj/chrome/browser/search_engines/libprepopulated_engines.a obj/components/libvisitedlink_renderer.a obj/ui/libshell_dialogs.a obj/sandbox/libsandbox_services.a obj/third_party/libwebp/libwebp_demux.a obj/third_party/sqlite/libsqlite3.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_svg.a obj/native_client/src/trusted/cpu_features/libcpu_features.a obj/chrome/libutility.a obj/chrome/libbrowser_ui_views.a obj/device/libdevice_bluetooth.a obj/components/libauto_login_parser.a obj/third_party/libjpeg_turbo/libjpeg_turbo.a obj/third_party/modp_b64/libmodp_b64.a obj/third_party/cacheinvalidation/libcacheinvalidation_proto_cpp.a obj/webkit/support/libwebkit_storage.a obj/chrome/libin_memory_url_index_cache_proto.a obj/v8/tools/gyp/libv8_base.x64.a obj/native_client/src/trusted/validator/x86/ncval_reg_sfi/libncval_reg_sfi_x86_64.a obj/sync/libsync_api.a obj/native_client/src/shared/srpc/libnonnacl_srpc.a obj/build/linux/libgio.a obj/third_party/flac/libflac.a obj/third_party/speex/libspeex.a obj/media/libmedia_sse2.a obj/third_party/re2/libre2.a obj/net/third_party/nss/libcrssl.a obj/jingle/libjingle_glue.a obj/components/libautofill_browser.a obj/native_client/src/shared/platform/libplatform.a libyuv.a obj/chrome/common/extensions/api/libapi.a obj/content/libcontent_common.a obj/base/libbase_i18n.a obj/components/libsessions.a obj/base/libbase.a obj/ppapi/libppapi_proxy.a obj/webkit/support/libwebkit_common.a obj/webkit/support/libglue_renderer.a obj/jingle/libnotifier.a obj/third_party/libwebp/libwebp_dec.a obj/components/libautofill_renderer.a obj/third_party/WebKit/Source/wtf/libwtf.a obj/sync/libsync_proto.a obj/remoting/libremoting_protocol.a obj/gpu/libgles2_c_lib.a obj/chrome/libcommon_net.a obj/gpu/libgpu_config.a obj/native_client/src/trusted/fault_injection/libnacl_fault_inject.a obj/net/libhttp_server.a obj/chrome/libcommon.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_rendering.a obj/dbus/libdbus.a obj/remoting/libremoting_client_plugin.a obj/content/libcontent_app.a obj/native_client/src/trusted/perf_counter/libnacl_perf_counter.a obj/printing/libprinting.a obj/content/libcontent_renderer.a obj/breakpad/libbreakpad_client.a obj/device/libmtp_file_entry_proto.a obj/native_client/src/trusted/debug_stub/libdebug_stub.a obj/third_party/hyphen/libhyphen.a obj/third_party/iccjpeg/libiccjpeg.a obj/third_party/icu/libicui18n.a obj/third_party/webrtc/modules/libdesktop_capture.a obj/native_client/src/trusted/validator/x86/decoder/libnc_opcode_modeling_x86_64.a obj/media/libshared_memory_support_sse.a obj/components/libvisitedlink_browser.a obj/content/libcontent_plugin.a obj/third_party/v8-i18n/build/libv8-i18n.a obj/skia/libskia.a obj/webkit/common/gpu/libwebkit_gpu.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_derived.a obj/chrome/libsafe_browsing_proto.a obj/net/libnet_with_v8.a obj/sql/libsql.a obj/components/libautofill_common.a obj/content/libcontent_ppapi_plugin.a obj/third_party/webrtc/system_wrappers/source/libsystem_wrappers.a obj/native_client/src/trusted/validator/x86/decoder/libnc_decoder_x86_64.a obj/native_client/src/trusted/platform_qualify/libplatform_qual_lib.a obj/gpu/command_buffer/libgles2_utils.a obj/native_client/src/trusted/gio/libgio_wrapped_desc.a obj/ui/libui.a obj/components/libencryptor.a obj/native_client/src/trusted/manifest_name_service_proxy/libmanifest_proxy.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_dom.a obj/device/libmtp_storage_info_proto.a obj/chrome/libsafe_browsing_report_proto.a obj/components/libautofill_risk_proto.a obj/third_party/ffmpeg/libffmpeg.a obj/components/libnavigation_interception.a obj/gpu/libcommand_buffer_service.a obj/chrome/libmetrics_proto.a obj/third_party/WebKit/Source/weborigin/libweborigin.a obj/third_party/WebKit/Source/modules/libmodules.a obj/media/libmedia.a obj/third_party/zlib/libchrome_zlib.a obj/third_party/WebKit/Source/core/core.gyp/libwebcore_remaining.a obj/native_client/src/trusted/service_runtime/libsel.a obj/components/libtracing.a obj/components/libvisitedlink_common.a  -Wl,--end-group -lX11 -lXcursor -lXrandr -lXrender -lXss -lXext -lrt -ldl -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lXtst -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lXi -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lgconf-2 -lresolv -lXcomposite -lasound -lXdamage -lXfixes -lcups -lgnutls -lgcrypt -lgpg-error -lz -lpthread -lcrypt -lm -L/usr/lib64 -lexpat -ldbus-1 -ludev
Comment 1 Ian Lance Taylor 2013-06-20 20:46:48 UTC
What does "ulimit -n" display?
Comment 2 Cary Coutant 2013-06-20 20:52:54 UTC
Is there any way that you can shrink the extent of the --start-group/--end-group options? My first guess is that it's related to having all those files inside the library group. In particular, .o files do not need to be inside the group. It might be better to build a thin archive from all those .a files, then just link against the thin archive (the linker will treat all the nested member libraries as one giant archive library).
Comment 3 Martin Liška 2013-06-20 21:10:16 UTC
ulimit -n
1024

I tried same command line without --start-group/--end-group, but didn't help.

Next step was to create one large archive, so:

ar r [list of all *.a] /tmp/lib.a

g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -pie -L. -flto=9 -fno-fat-lto-objects -O2 --param lto-partitions=64 -o chrome obj/chrome/app/chrome.chrome_exe_main_gtk.o obj/chrome/app/chrome.chrome_main.o obj/chrome/app/chrome.chrome_main_delegate.o /tmp/lib.a -lX11 -lXcursor -lXrandr -lXrender -lXss -lXext -lrt -ldl -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lXtst -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lXi -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lgconf-2 -lresolv -lXcomposite -lasound -lXdamage -lXfixes -lcups -lgnutls -lgcrypt -lgpg-error -lz -lpthread -lcrypt -lm -L/usr/lib64 -lexpat -ldbus-1 -ludev

I was shown big amount of undefined symbols, did I use the correct way how to create the archive?

Thanks,
Martin
Comment 4 Cary Coutant 2013-06-20 21:34:19 UTC
> Next step was to create one large archive, so:
>
> ar r [list of all *.a] /tmp/lib.a
>
> g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -pie -L. -flto=9
> -fno-fat-lto-objects -O2 --param lto-partitions=64 -o chrome
> obj/chrome/app/chrome.chrome_exe_main_gtk.o obj/chrome/app/chrome.chrome_main.o
> obj/chrome/app/chrome.chrome_main_delegate.o /tmp/lib.a -lX11 -lXcursor
> -lXrandr -lXrender -lXss -lXext -lrt -ldl -lgmodule-2.0 -lgobject-2.0
> -lgthread-2.0 -lglib-2.0 -lXtst -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0
> -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype
> -lfontconfig -lXi -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lgconf-2
> -lresolv -lXcomposite -lasound -lXdamage -lXfixes -lcups -lgnutls -lgcrypt
> -lgpg-error -lz -lpthread -lcrypt -lm -L/usr/lib64 -lexpat -ldbus-1 -ludev
>
> I was shown big amount of undefined symbols, did I use the correct way how to
> create the archive?

You need the 'T' option to make a thin archive. Otherwise an archive
of other archives makes a plain non-library archive file.

-cary
Comment 5 Martin Liška 2013-06-20 22:00:46 UTC
I did so, thin library was created, but linker is still complaining about file descriptors:

g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -pie -L. -flto=9 -fno-fat-lto-objects -O2 --param lto-partitions=64 -o chrome obj/chrome/app/chrome.chrome_exe_main_gtk.o obj/chrome/app/chrome.chrome_main.o obj/chrome/app/chrome.chrome_main_delegate.o lib.a -lX11 -lXcursor -lXrandr -lXrender -lXss -lXext -lrt -ldl -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lXtst -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lXi -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lgconf-2 -lresolv -lXcomposite -lasound -lXdamage -lXfixes -lcups -lgnutls -lgcrypt -lgpg-error -lz -lpthread -lcrypt -lm -L/usr/lib64 -lexpat -ldbus-1 -ludev
Comment 6 Cary Coutant 2013-06-20 22:13:25 UTC
Does the problem only happen with -flto? I wonder if the plugin is
keeping files open.

Can you tar up the build directory so I can try to repro the problem?

-cary


On Thu, Jun 20, 2013 at 1:43 PM, marxin.liska at gmail dot com
<sourceware-bugzilla@sourceware.org> wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=15660
>
>             Bug ID: 15660
>            Summary: out of file descriptors and couldn't close any
>            Product: binutils
>            Version: 2.23
>             Status: NEW
>           Severity: normal
>           Priority: P2
>          Component: gold
>           Assignee: ian at airs dot com
>           Reporter: marxin.liska at gmail dot com
>                 CC: ccoutant at google dot com
>
> I've encountered similar bug to:
> http://sourceware.org/bugzilla/show_bug.cgi?id=10708 during linking of chromium
> binary.
>
> ld --version
> GNU gold (GNU Binutils 2.23.52.20130526) 1.11
>
> Command line:
> FAILED: flock linker.lock g++ -Wl,-z,now -Wl,-z,relro -pthread
> -Wl,-z,noexecstack -fPIC -pie -L. -flto=9 -fno-fat-lto-objects -O2 --param
> lto-partitions=64 -o chrome -Wl,--start-group
> obj/chrome/app/chrome.chrome_exe_main_gtk.o obj/chrome/app/chrome.chrome_main.o
> obj/chrome/app/chrome.chrome_main_delegate.o obj/chrome/libinstaller_util.a
> obj/media/libmedia_sse.a obj/third_party/icu/libicuuc.a
> obj/third_party/libjingle/libjingle.a obj/skia/libskia_opts.a
> obj/third_party/icu/libicudata.a obj/device/libdevice_media_transfer_protocol.a
> obj/native_client/src/trusted/service_runtime/arch/x86/libservice_runtime_x86_common.a
> obj/chrome/libservice.a obj/chrome/librenderer.a obj/webkit/support/libglue.a
> obj/content/libcontent_worker.a obj/third_party/libwebp/libwebp_utils.a
> obj/third_party/zlib/libminizip.a
> obj/chrome/browser/performance_monitor/libperformance_monitor.a
> obj/third_party/leveldatabase/libleveldatabase.a
> obj/native_client/src/trusted/service_runtime/libenv_cleanser.a
> obj/sandbox/libc_urandom_override.a obj/chrome/libbrowser.a
> obj/ppapi/libppapi_host.a obj/sync/libsync_core.a obj/gpu/libgles2_cmd_helper.a
> obj/third_party/smhasher/libcityhash.a
> obj/third_party/libphonenumber/libphonenumber.a
> obj/chrome/app/policy/libpolicy.a obj/webkit/support/libplugins_common.a
> obj/native_client/src/trusted/validator_x86/libnccopy_x86_64.a
> obj/webkit/support/libglue_common.a
> obj/webkit/renderer/compositor_bindings/libwebkit_compositor_support.a
> obj/third_party/smhasher/libmurmurhash3.a obj/content/libcontent_gpu.a
> obj/native_client/src/trusted/threading/libthread_interface.a
> obj/media/libmedia_mmx.a obj/ipc/libipc.a obj/third_party/libxslt/libxslt.a
> obj/remoting/libremoting_client.a obj/third_party/ots/libots.a
> obj/base/libsymbolize.a obj/native_client/src/trusted/validator/libvalidators.a
> obj/chrome/libbrowser_extensions.a obj/skia/libskia_opts_ssse3.a
> obj/third_party/protobuf/libprotobuf_lite.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_platform.a
> obj/ui/surface/libsurface.a
> obj/third_party/WebKit/Source/WebKit/chromium/libwebkit.a
> obj/native_client/src/trusted/validator/x86/64/libncvalidate_x86_64.a
> obj/third_party/jsoncpp/libjsoncpp.a obj/google_apis/libgoogle_apis.a
> obj/chrome/libnacl.a
> obj/third_party/libphonenumber/libphonenumber_without_metadata.a
> obj/chrome/libdebugger.a obj/v8/tools/gyp/libv8_snapshot.a
> obj/ui/native_theme/libnative_theme.a obj/third_party/libusb/libusb.a
> obj/content/libcontent_common_child.a
> obj/native_client/src/trusted/nacl_base/libnacl_base.a
> obj/base/libbase_static.a obj/native_client/src/shared/imc/libimc.a
> obj/chrome/libfeedback_proto.a
> obj/components/libbrowser_context_keyed_service.a obj/components/libweb_modal.a
> obj/chrome/libapps.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_platform_geometry.a
> obj/components/libuser_prefs.a obj/content/libcontent_utility.a
> obj/third_party/libevent/libevent.a obj/sandbox/libseccomp_bpf.a
> obj/build/linux/libpci.a obj/ui/gl/libgl_wrapper.a
> obj/third_party/mt19937ar/libmt19937ar.a
> obj/third_party/angle/src/libtranslator_common.a
> obj/ui/message_center/libmessage_center.a obj/third_party/libpng/libpng.a
> obj/components/libwebdata_common.a obj/third_party/opus/libopus.a
> obj/sync/libsync_notifier.a obj/ui/snapshot/libsnapshot.a
> obj/native_client/src/trusted/validator/x86/libncval_base_x86_64.a
> obj/webkit/support/libwebkit_media.a obj/third_party/libwebp/libwebp_dsp.a
> obj/third_party/harfbuzz-ng/libharfbuzz-ng.a
> obj/chrome/app/policy/libcloud_policy_proto_generated_compile.a
> obj/base/allocator/liballocator_extension_thunks.a
> obj/remoting/libremoting_jingle_glue.a
> obj/native_client/src/trusted/service_runtime/libnacl_error_code.a
> obj/third_party/snappy/libsnappy.a obj/cc/libcc.a
> obj/third_party/libjingle/libjingle_p2p_constants.a
> obj/third_party/cld/libcld.a obj/third_party/libxml/libxml2.a
> obj/webkit/support/libplugins.a obj/chrome/libvariations_seed_proto.a
> obj/remoting/proto/libchromotocol_proto_lib.a
> obj/native_client/src/trusted/simple_service/libsimple_service.a
> obj/chrome/libsync_file_system_proto.a obj/gpu/libdisk_cache_proto.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_html.a
> obj/native_client/src/trusted/interval_multiset/libnacl_interval.a
> obj/build/linux/libspeechd.a obj/sync/libsync_internal_api.a
> obj/third_party/hunspell/libhunspell.a obj/chrome/libplugin.a
> obj/ui/compositor/libcompositor.a obj/base/libbase_prefs.a
> obj/ui/web_dialogs/libweb_dialogs.a
> obj/native_client/src/trusted/desc/libdesc_wrapper.a
> obj/third_party/angle/src/libpreprocessor.a obj/gpu/libgpu_ipc.a
> obj/device/libdevice_usb.a obj/sandbox/libsuid_sandbox_client.a
> obj/tools/json_schema_compiler/libapi_gen_util.a
> obj/third_party/cacheinvalidation/libcacheinvalidation.a
> obj/webkit/support/libwebkit_base.a obj/remoting/libremoting_base.a
> obj/gpu/libcommand_buffer_client.a obj/gpu/libcommand_buffer_common.a
> obj/native_client/src/trusted/service_runtime/arch/x86_64/libservice_runtime_x86_64.a
> obj/third_party/libwebp/libwebp_enc.a
> obj/native_client/src/trusted/validator_ragel/libdfa_validate_x86_64.a
> obj/native_client/src/trusted/desc/libnrd_xfer.a
> obj/chrome/libcert_logger_proto.a obj/ppapi/libppapi_ipc.a obj/sdch/libsdch.a
> obj/third_party/angle/src/libtranslator_glsl.a obj/ppapi/libppapi_shared.a
> obj/gpu/libgles2_implementation.a obj/third_party/libXNVCtrl/libXNVCtrl.a
> obj/content/browser/speech/proto/libspeech_proto.a
> obj/build/temp_gyp/libgoogleurl.a obj/webkit/support/libuser_agent.a
> obj/net/libnet.a obj/media/libmedia_asm.a obj/base/libxdg_mime.a
> obj/chrome/libcloud_policy_proto.a obj/content/libcontent_browser.a
> obj/native_client/src/trusted/validator/libvalidation_cache.a
> obj/chrome/libbrowser_ui.a obj/chrome/libcommon_constants.a
> obj/base/third_party/dynamic_annotations/libdynamic_annotations.a
> obj/third_party/sfntly/libsfntly.a obj/ppapi/libppapi_cpp_objects.a
> obj/third_party/zlib/libzip.a obj/crypto/libcrcrypto.a
> obj/webkit/renderer/compositor_bindings/libwebkit_compositor_bindings.a
> obj/media/libshared_memory_support.a obj/third_party/undoview/libundoview.a
> obj/native_client/src/shared/gio/libgio.a obj/third_party/qcms/libqcms.a
> obj/chrome/browser/search_engines/libprepopulated_engines.a
> obj/components/libvisitedlink_renderer.a obj/ui/libshell_dialogs.a
> obj/sandbox/libsandbox_services.a obj/third_party/libwebp/libwebp_demux.a
> obj/third_party/sqlite/libsqlite3.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_svg.a
> obj/native_client/src/trusted/cpu_features/libcpu_features.a
> obj/chrome/libutility.a obj/chrome/libbrowser_ui_views.a
> obj/device/libdevice_bluetooth.a obj/components/libauto_login_parser.a
> obj/third_party/libjpeg_turbo/libjpeg_turbo.a
> obj/third_party/modp_b64/libmodp_b64.a
> obj/third_party/cacheinvalidation/libcacheinvalidation_proto_cpp.a
> obj/webkit/support/libwebkit_storage.a
> obj/chrome/libin_memory_url_index_cache_proto.a
> obj/v8/tools/gyp/libv8_base.x64.a
> obj/native_client/src/trusted/validator/x86/ncval_reg_sfi/libncval_reg_sfi_x86_64.a
> obj/sync/libsync_api.a obj/native_client/src/shared/srpc/libnonnacl_srpc.a
> obj/build/linux/libgio.a obj/third_party/flac/libflac.a
> obj/third_party/speex/libspeex.a obj/media/libmedia_sse2.a
> obj/third_party/re2/libre2.a obj/net/third_party/nss/libcrssl.a
> obj/jingle/libjingle_glue.a obj/components/libautofill_browser.a
> obj/native_client/src/shared/platform/libplatform.a libyuv.a
> obj/chrome/common/extensions/api/libapi.a obj/content/libcontent_common.a
> obj/base/libbase_i18n.a obj/components/libsessions.a obj/base/libbase.a
> obj/ppapi/libppapi_proxy.a obj/webkit/support/libwebkit_common.a
> obj/webkit/support/libglue_renderer.a obj/jingle/libnotifier.a
> obj/third_party/libwebp/libwebp_dec.a obj/components/libautofill_renderer.a
> obj/third_party/WebKit/Source/wtf/libwtf.a obj/sync/libsync_proto.a
> obj/remoting/libremoting_protocol.a obj/gpu/libgles2_c_lib.a
> obj/chrome/libcommon_net.a obj/gpu/libgpu_config.a
> obj/native_client/src/trusted/fault_injection/libnacl_fault_inject.a
> obj/net/libhttp_server.a obj/chrome/libcommon.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_rendering.a
> obj/dbus/libdbus.a obj/remoting/libremoting_client_plugin.a
> obj/content/libcontent_app.a
> obj/native_client/src/trusted/perf_counter/libnacl_perf_counter.a
> obj/printing/libprinting.a obj/content/libcontent_renderer.a
> obj/breakpad/libbreakpad_client.a obj/device/libmtp_file_entry_proto.a
> obj/native_client/src/trusted/debug_stub/libdebug_stub.a
> obj/third_party/hyphen/libhyphen.a obj/third_party/iccjpeg/libiccjpeg.a
> obj/third_party/icu/libicui18n.a
> obj/third_party/webrtc/modules/libdesktop_capture.a
> obj/native_client/src/trusted/validator/x86/decoder/libnc_opcode_modeling_x86_64.a
> obj/media/libshared_memory_support_sse.a
> obj/components/libvisitedlink_browser.a obj/content/libcontent_plugin.a
> obj/third_party/v8-i18n/build/libv8-i18n.a obj/skia/libskia.a
> obj/webkit/common/gpu/libwebkit_gpu.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_derived.a
> obj/chrome/libsafe_browsing_proto.a obj/net/libnet_with_v8.a obj/sql/libsql.a
> obj/components/libautofill_common.a obj/content/libcontent_ppapi_plugin.a
> obj/third_party/webrtc/system_wrappers/source/libsystem_wrappers.a
> obj/native_client/src/trusted/validator/x86/decoder/libnc_decoder_x86_64.a
> obj/native_client/src/trusted/platform_qualify/libplatform_qual_lib.a
> obj/gpu/command_buffer/libgles2_utils.a
> obj/native_client/src/trusted/gio/libgio_wrapped_desc.a obj/ui/libui.a
> obj/components/libencryptor.a
> obj/native_client/src/trusted/manifest_name_service_proxy/libmanifest_proxy.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_dom.a
> obj/device/libmtp_storage_info_proto.a
> obj/chrome/libsafe_browsing_report_proto.a
> obj/components/libautofill_risk_proto.a obj/third_party/ffmpeg/libffmpeg.a
> obj/components/libnavigation_interception.a obj/gpu/libcommand_buffer_service.a
> obj/chrome/libmetrics_proto.a
> obj/third_party/WebKit/Source/weborigin/libweborigin.a
> obj/third_party/WebKit/Source/modules/libmodules.a obj/media/libmedia.a
> obj/third_party/zlib/libchrome_zlib.a
> obj/third_party/WebKit/Source/core/core.gyp/libwebcore_remaining.a
> obj/native_client/src/trusted/service_runtime/libsel.a
> obj/components/libtracing.a obj/components/libvisitedlink_common.a
> -Wl,--end-group -lX11 -lXcursor -lXrandr -lXrender -lXss -lXext -lrt -ldl
> -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lXtst -lgtk-x11-2.0
> -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0
> -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lXi -lsmime3
> -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lgconf-2 -lresolv -lXcomposite
> -lasound -lXdamage -lXfixes -lcups -lgnutls -lgcrypt -lgpg-error -lz -lpthread
> -lcrypt -lm -L/usr/lib64 -lexpat -ldbus-1 -ludev
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 7 Martin Liška 2013-06-20 22:30:04 UTC
I'll try to link it without -flto, but I used -fno-fat-lto-objects. It will take me some time to recompile chromium.

Weird is that ld.bfd is able to link the binary with -flto (aside gcc related errors).
Comment 8 Markus Trippelsdorf 2013-11-21 08:40:33 UTC
Also happens during clang lto build of chromium.
Comment 9 Markus Trippelsdorf 2013-11-21 13:55:03 UTC
In my case, I just had to increase the limits.
Gold has 18718 files open during the final Chromium link:
 % lsof -c ld |wc -l
18718
Comment 10 Cary Coutant 2014-02-21 00:15:06 UTC
Waiting for a tarball for repro.
Comment 11 Martin Liška 2014-03-17 17:35:14 UTC
There's my out/Release build folder:
https://drive.google.com/file/d/0B0pisUJ80pO1UzFGNGJhaW1xbVE/edit?usp=sharing

It's ~3.4GB tar with bzip2 (~6GB extracted).

ld --version:
GNU gold (GNU Binutils 2.24.51.20140304) 1.11

liblto plugin and command line argument for ld are attached in the tar I will upload.
Comment 12 Martin Liška 2014-03-17 17:36:10 UTC
Created attachment 7476 [details]
ld args and liblto plugin
Comment 13 H.J. Lu 2015-01-28 19:17:25 UTC
This is related to

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64837
Comment 14 H.J. Lu 2015-01-28 19:43:21 UTC
Since

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64837

has been fixed, now it becomes a dup.

*** This bug has been marked as a duplicate of bug 17896 ***
Comment 15 Cary Coutant 2015-02-04 03:25:40 UTC
Not a duplicate. PR 17896 is not a bug, and the leakage of file descriptors is unrelated to the use of the release_input_file plugin API.

Thanks to Peter Collingbourne, I'm now fairly certain that this bug is due to the failure to unlock an external member of a thin archive after claiming it via the plugin interface. I have a patch ready.
Comment 16 cvs-commit@gcc.gnu.org 2015-02-04 04:06:53 UTC
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2cfbf2fece582c29df348104b28677c38a8301f4

commit 2cfbf2fece582c29df348104b28677c38a8301f4
Author: Cary Coutant <ccoutant@google.com>
Date:   Tue Feb 3 19:54:57 2015 -0800

    Fix a file descriptor leak in gold.
    
    When an LTO linker plugin claims an external member of a thin archive, gold
    does not properly unlock the file and make its file descriptor available for
    reuse. This patch fixes the problem by modifying Archive::include_member to
    unlock the object file via an RAII class instance, ensuring that it will be
    unlocked no matter what path is taken through the function.
    
    gold/
    	PR gold/15660
    	* archive.cc (Thin_archive_object_unlocker): New class.
    	(Archive::include_member): Unlock external members of thin archives.
    	* testsuite/Makefile.am (plugin_test_1): Rename .syms files.
    	(plugin_test_2): Likewise.
    	(plugin_test_3): Likewise.
    	(plugin_test_4): Likewise.
    	(plugin_test_5): Likewise.
    	(plugin_test_6): Likewise.
    	(plugin_test_7): Likewise.
    	(plugin_test_8): Likewise.
    	(plugin_test_9): Likewise.
    	(plugin_test_10): Likewise.
    	(plugin_test_11): New test case.
    	* testsuite/Makefile.in: Regenerate.
    	* testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
    	file to decide whether to claim file.
    	(all_symbols_read_hook): Likewise.
    	* testsuite/plugin_test_1.sh: Adjust expected output.
    	* testsuite/plugin_test_2.sh: Likewise.
    	* testsuite/plugin_test_3.sh: Likewise.
    	* testsuite/plugin_test_6.sh: Likewise.
    	* testsuite/plugin_test_tls.sh: Likewise.
    	* testsuite/plugin_test_11.sh: New testcase.
Comment 17 Markus Trippelsdorf 2015-02-12 09:24:36 UTC
Fixed. Thank you.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64837#c19