{"id":21711681,"url":"https://github.com/chocohead/crafty-crashes","last_synced_at":"2025-04-12T17:41:49.458Z","repository":{"id":44374254,"uuid":"387048841","full_name":"Chocohead/Crafty-Crashes","owner":"Chocohead","description":"Corrects crash report stack traces to line up with any Mixins they contain","archived":false,"fork":false,"pushed_at":"2021-07-20T01:52:38.000Z","size":18,"stargazers_count":29,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T12:02:56.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chocohead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-17T22:41:32.000Z","updated_at":"2024-03-02T14:13:09.000Z","dependencies_parsed_at":"2022-07-13T00:50:47.904Z","dependency_job_id":null,"html_url":"https://github.com/Chocohead/Crafty-Crashes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocohead%2FCrafty-Crashes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocohead%2FCrafty-Crashes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocohead%2FCrafty-Crashes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocohead%2FCrafty-Crashes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chocohead","download_url":"https://codeload.github.com/Chocohead/Crafty-Crashes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248608058,"owners_count":21132656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T23:29:00.476Z","updated_at":"2025-04-12T17:41:49.437Z","avatar_url":"https://github.com/Chocohead.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crafty Crashes\nA Fabric mod which modifies stack traces in crash reports to include the relevant Mixin and source line number where appropriate, acting as a super [Mixin Trace](//github.com/comp500/mixintrace) whilst still working alongside it. Includes an [SMAP](https://jcp.org/en/jsr/detail?id=45) reader in the off chance you need one too.\n\nTested on 1.16.5 and 1.17.1, likely to work on many other versions which have similar crash reporting logic\n\n### Example\nUsing the following Mixin as an example of a Mixin which causes issues at runtime:\n```java\n@Mixin(Keyboard.class)\nabstract class BadMixin {\n\t@Dynamic(\"1.16 Lambda\")\n\t@Group(min = 1, max = 1)\n\t@Inject(method = \"method_1454(I[ZLnet/minecraft/client/gui/ParentElement;III)V\",\n\t\t\tat = @At(value = \"INVOKE\", target = \"Lnet/minecraft/client/gui/ParentElement;keyPressed(III)Z\"))\n\tprivate void beforeKeyPressedEvent(int code, boolean[] resultHack, ParentElement parentElement, int key, int scancode, int modifiers, CallbackInfo call) {\n\t\tif (key == GLFW.GLFW_KEY_T) {\n\t\t\tthrow new RuntimeException(\"Oh no a crash\");\n\t\t}\n\t}\n\n\t@Dynamic(\"1.17 Lambda\")\n\t@Group(min = 1, max = 1)\n\t@Inject(method = \"method_1454(ILnet/minecraft/client/gui/screen/Screen;[ZIII)V\",\n\t\t\tat = @At(value = \"INVOKE\", target = \"Lnet/minecraft/client/gui/screen/Screen;keyPressed(III)Z\"))\n\tprivate void beforeKeyPressedEvent(int code, Screen screen, boolean[] resultHack, int key, int scancode, int modifiers, CallbackInfo call) {\n\t\tbeforeKeyPressedEvent(code, resultHack, screen, key, scancode, modifiers, call);\n\t}\n}\n```\nNormally when this is run you'd get the following crash report section (which is effectively the top frames of the full stack trace):\n```\n-- Head --\nThread: Render thread\nStacktrace:\n\tat net.minecraft.class_309.handler$zzg001$beforeKeyPressedEvent(class_309.java:1075)\n\tat net.minecraft.class_309.handler$zzg001$beforeKeyPressedEvent(class_309.java:1084)\n\tat net.minecraft.class_309.method_1454(class_309.java:374)\n```\n`Keyboard` only has around 520 lines, so 1075 and 1084 are entirely unhelpful to finding what is wrong. The only knowledge gained is that the Mixin which crashed had handlers called `beforeKeyPressedEvent`.\n\nIn contrast, running with Crafty Crashes:\n```\n-- Head --\nThread: Render thread\nStacktrace:\n\tat net.minecraft.class_309.handler$zzg001$beforeKeyPressedEvent(com/chocohead/example/mixin/BadMixin.java [cc-example.mixins.json]:24)\n\tat net.minecraft.class_309.handler$zzg001$beforeKeyPressedEvent(com/chocohead/example/mixin/BadMixin.java [cc-example.mixins.json]:33)\n\tat net.minecraft.class_309.method_1454(class_309.java:374)\n```\nNow we have the fully qualified name of the Mixin which has gone wrong, the Mixin config which registered it, and the correct line numbers for the Mixin. This makes finding and debugging the Mixin much easier, especially as searching for a Mixin config by name on Github is more likely to return a unique result than searching the handler or Mixin class's name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocohead%2Fcrafty-crashes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchocohead%2Fcrafty-crashes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocohead%2Fcrafty-crashes/lists"}