All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

Crash in LLRemoteParcelInfoProcessor::processParcelInfoReply()

Review Request #24 - Created Dec. 15, 2010 and submitted

Kitty Barnett Reviewers
viewer
VWR-24207
None viewer-development
erase() on a multimap will only invalidate iterators that point to the element being erased so pre-incrementing the loop iterator should prevent it from getting invalidated when an observer calls removeObserver() as part of its processParcelInfo() implementation.

 
Review request changed
Updated (Dec. 16, 2010, 11:06 a.m.)
Added comments.

I'm wondering if there is still a reason for the deadlist_t related code now?

If that was "inlined" into the loop it would become:

	while (oi != end)
	{
		// increment the loop iterator now since it may become invalid below
		observer_multimap_t::iterator cur_oi = oi++;

		LLRemoteParcelInfoObserver * observer = cur_oi->second.get();
		if(observer)
		{
			// may invalidate cur_oi if the observer removes itself 
			observer->processParcelInfo(parcel_data);
		}
		else
		{
			// the handle points to an expired observer, so don't keep it
			// around anymore (invalidates cur_oi)
			observers.erase(cur_oi);
		}
	}

That might decrease the chance of the fix being reverted since even if the comment on "processParcelInfo" is missed, then "observers.erase()" would still make the need for two iterators ("oi" and "cur_oi") clear?
Posted (Dec. 16, 2010, 11:11 a.m.)
*confuzzled*

Does it want an incremental change starting at the previous diff? Or a diff that includes the original diff (starting from viewer-dev)?
  1. When I click on the link 'Diff r2', I don't get a diff - I get an error message that 2 our of 5 hunks failed to apply.
    
  2. I know :|. 
    
    That's why I asked if "update diff" wants an incremental diff (changes against the original diff), or a full diff (changes against viewer-development), or something else entirely?