This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][patch] Fix file descriptor leak


Cary Coutant <ccoutant@google.com> writes:

>         PR gold/10708
>         * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
>         object when reading from the file.
>         * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
>         second layout pass.
>         * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
>         when reading section contents.
>         (get_section_contents): Likewise.
>         (icf::find_identical_sections): Likewise.
>         * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
>         object when reading from the file.
>         * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
>         the object when doing deferred section layout.

This is OK.

We should add that assert you mentioned as soon as we can.

We should also add some notion to the workqueue as to whether we are
running single-threaded.  We can use that to assert if there are ever
two jobs runnable when we think we are single-threaded.

We should then change these dummy_task Task_lock_obj calls to a
different locker which asserts that we are single threaded, does not
require a task, and calls variants of obj->lock and obj->unlock which do
not use a task.

Thanks for tracking this down.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]