secondlife / secondlife/viewer

LLGroupMgr::removeObserver can fail to find and erase observers causing a crash

Open
#6,050 1 comment 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #6051 by @Hecklezz — merged
bug
Dominant language
C++
Stars
299
Forks
146
Avg merge
1d 9h
Merged PRs (30d)
88

Description

Environment

Second Life Release 26.2.0.25386466510 (64bit)

Rest of Environment- Release Notes

CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (3600.01 MHz)
Memory: 16302 MB
OS Version: Microsoft Windows 10 64-bit (Build 19045.7548)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: NVIDIA GeForce RTX 2080/PCIe/SSE2

Windows Graphics Driver Version: 32.0.15.9636
OpenGL Version: 4.6.0 NVIDIA 596.36

Window size: 1920x1081
Font Size Adjustment: 96pt
UI Scaling: 1
Draw distance: 512m
Bandwidth: 10000kbit/s
LOD factor: 4
Render quality: 5
Texture memory: 8192MB
Disk cache: Max size 11468.8 MB (0.7% used)

J2C Decoder Version: KDU v8.4.1
Audio Driver Version: OpenAL, version 1.1 ALSOFT 1.24.2 / OpenAL Community / OpenAL Soft: OpenAL Soft
Dullahan: 1.24.0.202510081738
CEF: 139.0.40+g465474a+chromium-139.0.7258.139
Chromium: 139.0.7258.139
LibVLC Version: 3.0.21
Voice Server Version:

July 26 2026 10:31:33

Description

PR with possible fix: https://github.com/secondlife/viewer/pull/6051

Currently in the LLGroupMgr::removeObserver function here, the code is using std::multimap::find in order to get the first instance in the mObservers multimap and then iterate from there.
However this is incorrect and there is no guarantee that std::multimap::find will return the actual first instance in a multimap.

I observed recently crashes in LLGroupMgr::notifyObservers relating to LLGroupIconCtrl's where one of their observers had been deleted but it had never gotten erased from the mObservers in LLGroupMgr. This was because after some investigation, the mObservers.find was not returning the actual first instance of the corresponding observer id, so when it looped over the observers, it was never found and erased.

Reproduction steps

Cannot reproduce on demand, as this constitutes similar to undefined behaviour.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in indra/newview/llgroupmgr.cpp at LLGroupMgr::removeObserver and review how mObservers is searched and traversed. Check linked pull request 6051, which is merged, before doing any work; the intended result is that observers are reliably found and erased so notifyObservers cannot retain deleted observers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.