From acd80d80dda80ef3b6818b2fdb5b538866aae4c1 Mon Sep 17 00:00:00 2001 From: Stephane Sezer Date: Mon, 23 Mar 2015 17:05:41 +0000 Subject: [PATCH] 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 llvm-svn: 232966 --- .../Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index dc737bdeec34..7d8ee9cca9c2 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -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();