{"record":{"id":"e7bb546da51c053b","repo":"slint-ui/slint","slug":"unsupported-maybeuninit-layout-for-sharedvector-el","errorCode":null,"errorMessage":"unsupported MaybeUninit layout for SharedVector element type","messagePattern":"unsupported MaybeUninit layout for SharedVector element type","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"internal/core/gdb_pretty_printers.py","lineNumber":49,"sourceCode":"                yield f\"[{i}]\", (data_ptr + i).dereference()\n        except Exception as e:\n            yield \"<error>\", f\"error reading elements: {e}\"\n\n    def display_hint(self):\n        return \"array\"\n\n    @staticmethod\n    def _element_type(maybe_uninit_val):\n        ty = maybe_uninit_val.type\n        for field in ty.fields():\n            if field.name == \"value\":\n                val_type = field.type\n                if val_type.code == gdb.TYPE_CODE_STRUCT:\n                    for sub in val_type.fields():\n                        if sub.name in (\"value\", \"__0\", \"0\"):\n                            return sub.type\n                return val_type\n        raise RuntimeError(\n            \"unsupported MaybeUninit layout for SharedVector element type\"\n        )\n\n\nclass SharedVectorSubPrinter(gdb.printing.SubPrettyPrinter):\n    def __init__(self):\n        super().__init__(\"SharedVector\")\n\n    def __call__(self, val):\n        if not self.enabled:\n            return None\n        t = val.type.strip_typedefs()\n        if t.code == gdb.TYPE_CODE_PTR:  # also support reference to SharedVector\n            try:\n                val = val.dereference()\n                t = val.type.strip_typedefs()\n            except gdb.error:\n                return None","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/internal/core/gdb_pretty_printers.py#L31-L67","documentation":"Slint registers GDB pretty printers for its internal types (loaded via rust-gdb). When printing a SharedVector, the printer descends into the element type wrapped in core::mem::MaybeUninit and recognizes only known field layouts (a `value` field whose struct again has value/__0/0-style fields, or the value type directly). If the debug info layout does not match — typically because a different rustc version changed MaybeUninit's field naming — the printer raises this RuntimeError instead of printing the value.","triggerScenarios":"Executing `p some_shared_vector` (or letting GDB auto-print it) in rust-gdb/gdb with the Slint pretty printers registered, where the element's MaybeUninit layout is not one of the recognized shapes.","commonSituations":"Pretty printers from an older slint release used with a newer Rust toolchain (or vice versa); plain gdb instead of rust-gdb; a rustc nightly that restructured MaybeUninit internals.","solutions":["Update to the pretty printers matching your build (source internal/core/gdb_pretty_printers.py from the same slint revision).","Use rust-gdb from the same toolchain as the binary being debugged so debug info layouts line up.","As a workaround, disable the printer and inspect raw fields: `disable pretty-printer slint SharedVector`, then print the struct directly.","If it persists on matching versions, report the type layout upstream so the printer can learn it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load pretty printers from the same slint revision as the binary being debugged.","Use rust-gdb (matching toolchain) rather than plain gdb for Rust layouts.","Know the escape hatch: `disable pretty-printer slint SharedVector` to fall back to raw field display."],"tags":["gdb","debugging","rust","pretty-printers","rustc-version"],"backgroundTag":"gdb-pretty-printer-mismatch","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}