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

Stephane Sezer sas at cd80.net
Fri Mar 20 14:42:13 PDT 2015


Hi clayborg, tfiala,

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

http://reviews.llvm.org/D8495

Files:
  source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp

Index: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
===================================================================
--- source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -206,7 +206,12 @@
     // 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();

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8495.22379.patch
Type: text/x-patch
Size: 966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150320/33868f11/attachment.bin>


More information about the lldb-commits mailing list