[Lldb-commits] [lldb] r232966 - Do not assert on POSIXDYLD double-eAdd.

Stephane Sezer sas at cd80.net
Mon Mar 23 10:05:41 PDT 2015


Author: sas
Date: Mon Mar 23 12:05:41 2015
New Revision: 232966

URL: http://llvm.org/viewvc/llvm-project?rev=232966&view=rev
Log:
Do not assert on POSIXDYLD double-eAdd.

Summary:
This has been discovered while experimenting with the gecko linker on android.
In general, assert()'ing on "user input" is a bad idea.

Test Plan: Run unit tests.

Reviewers: clayborg, tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8495

Modified:
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=232966&r1=232965&r2=232966&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Mon Mar 23 12:05:41 2015
@@ -206,7 +206,12 @@ DYLDRendezvous::UpdateSOEntries()
     // state and take a snapshot of the currently loaded images.
     if (m_current.state == eAdd || m_current.state == eDelete)
     {
-        assert(m_previous.state == eConsistent || (m_previous.state == eAdd && m_current.state == eDelete));
+        // Some versions of the android dynamic linker might send two
+        // notifications with state == eAdd back to back. Ignore them
+        // until we get an eConsistent notification.
+        if (!(m_previous.state == eConsistent || (m_previous.state == eAdd && m_current.state == eDelete)))
+            return false;
+
         m_soentries.clear();
         m_added_soentries.clear();
         m_removed_soentries.clear();





More information about the lldb-commits mailing list