Dota2-Gameplay icon indicating copy to clipboard operation
Dota2-Gameplay copied to clipboard

[Mac] Root cause for Compendium / Team Bundles crash: missing printf argument in libclient.dylib (same crash as #34008)

Open thequesha opened this issue 4 months ago • 6 comments

Description

Root-cause analysis for the 100% reproducible macOS crash when opening the Compendium / International "Team Bundles".

This is the same crash as #34008 — identical libclient.dylib offsets in the backtrace — and is very likely the same defect behind #34014 and #34015. Filing separately because the analysis is specific and actionable; happy for it to be folded into #34008.

TL;DR: the function that builds team fan-content logo paths passes two arguments to a three-conversion format string. vsnprintf then reads a stale register as a char* and dereferences it.

Environment

  • macOS 26.5.2 (25F84), Apple Silicon, x86_64 under Rosetta 2, SIP enabled
  • ClientVersion 6877 / SourceRevision 10872334 / VersionDate Jul 30 2026
  • 9 crashes, all with an identical stack. Game updated 10:36:46 local, first crash 10:46:34.

The reported exception type is misleading

The crash reports blame EXC_GUARD / GUARD_TYPE_MACH_PORT / INVALID_OPTIONS on thread 3. Thread 3 is Breakpad:

3  libsystem_kernel.dylib  exception_raise
4  Breakpad                google_breakpad::ForwardException(unsigned int, unsigned int, int, int*, unsigned int)
5  libsystem_kernel.dylib  _Xexception_raise
6  libsystem_kernel.dylib  exc_server
7  Breakpad                google_breakpad::ExceptionHandler::WaitForMessage(void*)

Breakpad catches the real fault and then trips a Mach-port guard while forwarding it. The guard violation is what kills the process, so it masks the actual bug. (Some users see the real EXC_BAD_ACCESS (SIGSEGV) instead — see lawlozano93's report in #34008.)

The real crash — MainThrd

0  ???
1  libsystem_c.dylib  __vfprintf + 4717
2  libsystem_c.dylib  _vsnprintf + 242
3  libsystem_c.dylib  vsnprintf + 68
4  libtier0.dylib     V_vsnprintfSize + 54
5  libtier0.dylib     CBufferString::AppendFormatV(char const*, __va_list_tag*) + 317
6  libclient.dylib    + 0x1efbc     <- CBufferString::Format varargs wrapper at +0x1eee0
7  libclient.dylib    + 0x3245764   <- crash-site call, function starts at +0x3245660
8  libclient.dylib    + 0x3245a85   <- dispatcher at +0x32459a0

Root cause

The function at libclient.dylib+0x3245660 formats two paths per logo lookup. The .vtex_c variant is correct; the file:// URL variant omits the suffix argument. Three instructions apart, in the same function:

; .vtex_c lookup — CORRECT, 3 varargs
32457a0:  mov  rsi, [rbp-0x158]   ; "panorama/images/teamfancontent/season_%u/%u/teamlogo%s_png.vtex_c"
32457a7:  mov  edx, 0xc           ; %u  season
32457ac:  mov  ecx, r15d          ; %u  team id
32457af:  mov  r8,  r14           ; %s  "" or "_special"   <-- passed
32457b4:  call 0x1eee0

; file:// URL builder — BROKEN, 2 varargs
324574e:  mov  rsi, [rbp-0x148]   ; "file://{images}/teamfancontent/season_%u/%u/teamlogo%s.png"
3245755:  mov  edx, 0xd           ; %u  season
324575a:  mov  ecx, r15d          ; %u  team id
                                  ; %s  <-- NEVER SET; r8 holds junk from the preceding call
324575f:  call 0x1eee0            ; return address 0x3245764 == crash frame

r8 was last written before the FileExists-style vtable call at +0x3245723 and the call at +0x3245734, both of which clobber it. So %s consumes an indeterminate value.

Register evidence confirming it

At the fault, r10 and r15 point inside the format string at libclient+0x47dfcb6 = "file://{images}/teamfancontent/season_%u/%u/teamlogo%s.png":

Register Value Offset into format string Meaning
r10 0xda9f2ce1 43 parser just consumed the 2nd %u
r15 0xda9f2cec 54 parser just consumed %s
rdi 0xf340e970 — the %s pointer — not inside any mapped image

(libclient.dylib base was 0xd6213000 in this dump.)

So __vfprintf had just parsed %s and was dereferencing an unmapped garbage pointer. That is the crash.

The season-12 fallback has the same defect

324585e:  mov  rsi, [rbp-0x148]   ; same file:// template
3245865:  mov  edx, 0xc           ; season 12
324586a:  mov  ecx, r15d          ; team id
                                  ; %s  <-- also never set
324586f:  call 0x1eee0

All three logo sizes route through +0x3245660 (dispatcher at +0x32459a0 switches on size: 4 = small, 5 = medium, 6 = full), so every size is affected. My 9 dumps hit all three branches (+0x32459fe, +0x3245a85, +0x3245b0c).

Why it started with this patch

The broken branch only runs when the team's logo texture is found. This update shipped season_13 team logo assets for 16 teams under panorama/images/teamfancontent/season_13/<teamid>/ (teamlogo_png.vtex_c, _small, _medium, and _special variants). That made the path reachable for the first time, which is why the crash appeared with the Compendium content and not before.

Suggested fix

Pass the suffix argument to both file:// format calls — +0x324575f and +0x324586f — the same way the corresponding .vtex_c calls at +0x32456dd and +0x32457b4 already do (mov r8, r14).

Two side notes

  1. You are probably not receiving these crash reports. Breakpad dies on the Mach-port guard on macOS 26 while forwarding the exception, so the upload likely never happens. This may look much quieter in telemetry than it is in the wild.
  2. "Verify integrity of game files" does not help and is being widely recommended in the community threads — the shipped assets are fine, the defect is in the code.

Workaround for affected users

Avoid the Compendium pages that render team logos (International team bundles / team listings) until this is patched. Nothing else in the client is affected.

Example Match ID (and possibly Timestamp)

Not match-related — occurs in the main menu UI.

Screenshots

No response

thequesha avatar Jul 31 '26 10:07 thequesha

Reproduced this multiple times (opening team bundles or selecting fantasy players) with the same crash site.

macOS 26.6 (25G72) ClientVersion: 6877 SourceRevision: 10872334 VersionDate: Jul 30 2026 Steam Build ID: 24486396

rylm avatar Jul 31 '26 12:07 rylm

same for me

lowfnm avatar Jul 31 '26 13:07 lowfnm

+1

nikitunkun avatar Jul 31 '26 15:07 nikitunkun

Same defect on an older macOS — worth noting because of side note 1 in this issue.

macOS 14.6.1 (23G93), MacBookPro18,3 (M1 Pro), Rosetta 2. Trigger: Fantasy / Predictions.

Frames 6–18 are identical to #34008; the only difference is the dispatcher frame, +0x3245B0C instead of +0x3245A85 — i.e. one of the three size branches you listed.

Two additions:

  1. The Breakpad Mach-port guard death is not macOS 26-specific. I get the same EXC_GUARD / GUARD_TYPE_MACH_PORT / INVALID_OPTIONS on macOS 14.6.1, so the crash reports almost certainly aren't reaching Valve from Sonoma either. The telemetry blind spot is wider than "macOS 26".

  2. Frame 0 is symbolicated in my report — it is _platform_strlen + 18 (it shows as ??? in #34008 and in this issue). Direct confirmation that the fault is the strlen on the bogus %s pointer, not something further up __vfprintf.

0  libsystem_platform.dylib  _platform_strlen + 18
1  libsystem_c.dylib         __vfprintf + 5674
2  libsystem_c.dylib         _vsnprintf + 257
3  libsystem_c.dylib         vsnprintf + 68
4  libtier0.dylib            V_vsnprintfSize + 54
5  libtier0.dylib            CBufferString::AppendFormatV + 317
6  libclient.dylib           + 0x1EFBC
7  libclient.dylib           + 0x3245764
8  libclient.dylib           + 0x3245B0C
9  libclient.dylib           + 0x3246770

MisterFlicker avatar Jul 31 '26 15:07 MisterFlicker

Mac model: MacBook Pro 14-inch, November 2024 Chip: Apple M4 Pro Memory: 24 GB macOS version: macOS Tahoe 26.5

Dota 2 crashes every time I open Team Bundles, Fantasy, or any prediction section in the Compendium. The crash is consistently reproducible.

vinchence30 avatar Jul 31 '26 18:07 vinchence30

Mac M1 Pro same stuff

rekruizer avatar Jul 31 '26 20:07 rekruizer