{"record":{"id":"7723dfa97e781c4b","repo":"slint-ui/slint","slug":"unsupported-nonnull-layout-in-slice","errorCode":null,"errorMessage":"unsupported NonNull layout in Slice","messagePattern":"unsupported NonNull layout in Slice","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"internal/core/gdb_pretty_printers.py","lineNumber":112,"sourceCode":"            elem_type = data_ptr.type.target()\n            for i in range(length):\n                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    def _data_pointer(self):\n        nn = self.val[\"ptr\"]\n        if nn.type.code == gdb.TYPE_CODE_PTR:\n            return nn\n        for field in nn.type.fields():\n            if field.name in (\"pointer\", \"__0\", \"0\"):\n                candidate = nn[field]\n                if candidate.type.code == gdb.TYPE_CODE_PTR:\n                    return candidate\n        raise RuntimeError(\"unsupported NonNull layout in Slice\")\n\n\nclass SliceSubPrinter(gdb.printing.SubPrettyPrinter):\n    def __init__(self):\n        super().__init__(\"Slice\")\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 Slice\n            try:\n                val = val.dereference()\n                t = val.type.strip_typedefs()\n            except gdb.error:\n                return None\n        if (\n            t.code == gdb.TYPE_CODE_STRUCT","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/internal/core/gdb_pretty_printers.py#L94-L130","documentation":"Slice._data_pointer() unwraps the slice's NonNull to reach the data pointer for GDB pretty-printing. It recognizes the common Rust pointer field layouts (pointer, __0, tuple field 0); this error sentinel is yielded when the NonNull's type has none of those field names, i.e. a std layout change or an exotic NonNull representation the printer doesn't know. The input at fault is the GDB type of the ptr field, and the result is a '<error>' pseudo-child in the debugger view rather than a crash.","triggerScenarios":"Thrown at internal/core/gdb_pretty_printers.py:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the pretty printer's _data_pointer to handle the new NonNull layout by checking candidate.type.code == gdb.TYPE_CODE_PTR before use and adding the new wrapper field name to the accepted list","Print nn.type and its fields with 'info type' / ptype in GDB to identify the actual wrapper field and add it to (\"pointer\", \"__0\", \"0\")","Fall back to the raw address: use nn.reinterpret_cast(elem_type.pointer()) when no recognized pointer field is found","Verify the Rust std version; NonNull/Slice internal layouts changed across releases, so pin the debugger script expectations to the std version in use"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}