Skip to content

cmds.controller segfault crashes Maya 2025 on dagmenu right-click #623

@BramVR

Description

@BramVR

Description

Right-clicking on body/spine controls in the viewport hard-crashes Maya 2025 with a segfault. No Python traceback, no error message. Maya closes to desktop immediately.

Root Cause

get_all_tag_children() in pickWalk.py calls cmds.controller(tags, query=True, children=True) to traverse the controller tag hierarchy. This command has a C++ bug in Maya 2025 that causes a segfault on certain controller tag nodes. Since this is a C++ crash, try/except cannot catch it.

The crash happens during mgear_dagmenu_fill when building the right-click menu for controls that have controller tag children (e.g. body or spine controls that parent arm/hand/finger hierarchies).

Why It Affects Some Controls and Not Others

The crash is triggered by specific controller tag nodes that cmds.controller cannot handle. Controls higher in the hierarchy (body, spine) are more likely to crash because get_all_tag_children traverses all descendants. A spine control walks through neck, shoulders, arms, hands, fingers, and any additional child controls, making it more likely to encounter a problematic tag node. Controls lower in the hierarchy (arms, fingers) may work fine because their traversal covers a smaller subset that never reaches those tags.

In our case, the traversal from a spine control expanded across 6 iterations (5, 5, 15, 54, 61, 71 tags) before hitting the crash. Even splitting the batch call into individual per-tag queries still crashed, confirming the issue is with cmds.controller itself on specific tag nodes, not with the number of tags passed.

Steps to Reproduce

  1. Open a rig with controller tags (mGear-built rig with body/spine/arm hierarchy)
  2. Select a body or spine control
  3. Right-click in viewport
  4. Maya crashes (segfault, no error message)

Proposed Fix

Replace cmds.controller with direct cmds.listConnections traversal of the controller tag .children and .controllerObject attributes. This achieves the same result without using the buggy cmds.controller command. Also adds cycle protection via a seen_tags set.

Environment

  • Maya 2025 (build 202409190603)
  • mGear 5.2.1
  • Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Pending Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions