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]

[gold patch] Fix crash when a member of a lib group can't be opened


This patch fixes a problem where gold hit an internal error after
reporting an error for a file not found, if the missing file is a
member of a lib group. For lib groups, the next_blocker token is added
to the list of tokens to unblock automatically at the end of the task,
but a file not found would return false from do_read_symbols, and
Read_symbols::run would queue an unblock task, which would try to
unblock the token a second time.

Tested on x86_64.

-cary


2011-10-12  Cary Coutant  <ccoutant@google.com>

	* gold/readsyms.cc (Read_symbols::run): Don't queue an unblocker
	task for members of lib groups.


commit f3ada56242da20732e2788090e20c1ce9dcf6218
Author: Cary Coutant <ccoutant@google.com>
Date:   Wed Oct 12 22:37:46 2011 -0700

    Don't queue an unblock task for members of lib groups.

diff --git a/gold/readsyms.cc b/gold/readsyms.cc
index 1e50942..9974722 100644
--- a/gold/readsyms.cc
+++ b/gold/readsyms.cc
@@ -161,8 +161,10 @@ void
 Read_symbols::run(Workqueue* workqueue)
 {
   // If we didn't queue a new task, then we need to explicitly unblock
-  // the token.
-  if (!this->do_read_symbols(workqueue))
+  // the token. If the object is a member of a lib group, however,
+  // the token was already added to the list of locks for the task,
+  // and it will be unblocked automatically at the end of the task.
+  if (!this->do_read_symbols(workqueue) && this->member_ == NULL)
     workqueue->queue_soon(new Unblock_token(this->this_blocker_,
 					    this->next_blocker_));
 }


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