Consistent Crash (NULL Pointer @ +0x9844) with Pristine Examples (devkitA64 r28) After Clean Installs

Post Reply
estyxq
Posts: 2
Joined: Tue May 06, 2025 9:09 pm

Consistent Crash (NULL Pointer @ +0x9844) with Pristine Examples (devkitA64 r28) After Clean Installs

Post by estyxq » Tue May 06, 2025 9:38 pm

Summary of Problem

Hello devkitPro Team and Community,

I am experiencing a persistent and highly consistent issue where any Nintendo Switch NRO I compile using devkitPro crashes immediately upon launch from hbloader. This occurs even with pristine, unmodified examples taken directly from the $DEVKITPRO/examples/switch/templates/application directory.

This issue has been reproduced on two separate Windows 11 Pro 24H2 machines (one desktop, one laptop), both after full, clean installations of devkitPro.

Importantly, all precompiled NROs work perfectly fine on my Switch. This includes NROs downloaded via the HB AppStore directly on the Switch, as well as precompiled NROs downloaded on a PC and transferred to the SD card. The problem is strictly limited to applications compiled in my own devkitPro environment.

The crash always presents with the same signature: a Data Abort (NULL pointer dereference) at a consistent offset ([ModuleName] + 0x9844) within the compiled NRO, with an equally consistent early stack trace entry ([ModuleName] + 0xc4). The method of launching the NRO (applet mode vs. full-memory mode via hbmenu) makes no difference.

System Information

PC Environment (Tested on two separate machines with identical results):

  • Operating System: Windows 11 Pro, Version 24H2 (on both Desktop and Laptop)
  • devkitPro Updater Version Tried (on both machines):
    • Initially: devkitPro Updater 3.0.3
    • Currently (after full clean reinstall): devkitPro Updater 3.0.2
  • DevkitA64 Toolchain Version (consistent across both updaters and machines after package installations):
    • aarch64-none-elf-gcc.exe (devkitA64 release 28) 15.1.0
    • The GCC copyright notice for this version shows: Copyright (C) 2025 Free Software Foundation, Inc.
  • libnx Version: libnx-4.8.0-1 (as installed/reinstalled by pacman -S switch-dev)
  • MSYS2 Environment: Installed via the official devkitPro installers on each machine.

Nintendo Switch Environment:

  • Custom Firmware (CFW): Atmosphère v1.8.0
  • System Firmware Version: 19.0.1
  • Fuse Version: 20
  • SoC Type: Mariko

(full Atmosphère crash log for the $DEVKITPRO/examples/switch/templates/application/application.nro compiled with the 3.0.2 setup)

01746561279_01001f5010dfa000.log
(11.73 KiB) Not downloaded yet

estyxq
Posts: 2
Joined: Tue May 06, 2025 9:09 pm

Re: Consistent Crash (NULL Pointer @ +0x9844) with Pristine Examples (devkitA64 r28) After Clean Installs

Post by estyxq » Tue May 06, 2025 9:39 pm

Detailed Problem Description & Key Observations

  1. Any self-compiled application crashes: This includes my own projects and, critically, the pristine, untouched example application from $DEVKITPRO/examples/switch/templates/application/application.nro.
  2. Precompiled NROs work: All tested precompiled NROs from various sources (HB AppStore, online downloads like the original "Switch-Notification-LED") function without issue.
  3. Source of working NROs, when self-compiled, also crashes: My initial troubleshooting began when I took the source code for "Switch-Notification-LED" (which worked when using its provided precompiled NRO), compiled it myself using my devkitPro setup, and my version crashed.
  4. Launch mode does not matter: The crashes occur whether the NRO is launched in applet mode or full-memory mode (e.g., holding 'R' when launching a title to access Homebrew Menu).
  5. Issue reproducible on multiple PCs: The exact same crashing behavior with self-compiled pristine examples occurs on two different Windows 11 Pro 24H2 machines, each having undergone clean devkitPro installations.

Key Error Information (from Atmosphère Crash Reports)

The following details are identical across all crashes of self-compiled NROs on both machines (only absolute memory addresses and Process/Thread IDs change):

  • Result: 0x4A8 (2168-0002)
  • Process Name (in log): hbloader
  • Program ID (of hbloader): 01001f5010dfa000
  • Exception Type: Data Abort
  • Fault Address: 0x0000000000000000 (Attempt to access NULL pointer)
  • Crashed Program Counter (PC) Offset (within the NRO module): [ModuleName] + 0x9844
    • (e.g., application + 0x9844 or HelloWorld + 0x9844)
  • Early Stack Trace Entry (ReturnAddress[04] in logs, within NRO module): [ModuleName] + 0xc4
  • A black .jpg image is also sometimes generated in the /atmosphere/crash_reports/ folder for these crashes.

Extensive Troubleshooting Steps Performed (Applied on each machine)

  1. Initial State & Example Testing: Confirmed precompiled NROs work, self-compiled ones (even "HelloWorld" based on official examples, and later the pristine templates/application) crash.
  2. Environment Checks & pacman Updates (with devkitPro Updater 3.0.3 initially):
    • Used pacman successfully after dkp-pacman alias issues.
    • Ran pacman -Syuu and pacman -S switch-dev (reinstalling libnx-4.8.0-1 and devkitA64 r28).
  3. PATH Issues & Resolution with devkitPro 3.0.3 Installation:
    • aarch64-none-elf-gcc was initially not found in PATH.
    • Manually setting PATH for the session allowed compilation, but NROs still crashed.
  4. Full Clean Reinstall to devkitPro Updater 3.0.2:
    • Uninstalled devkitPro via its uninstaller.
    • Manually verified and deleted C:\devkitPro and associated MSYS2 installation directories.
    • Rebooted PC.
    • Installed devkitPro using devkitProUpdater-3.0.2.exe, selecting "Switch Development" components and allowing PATH modifications.
  5. Environment Confirmation with devkitPro 3.0.2:
    • aarch64-none-elf-gcc --version worked immediately in a fresh MSYS2 shell without manual PATH adjustments.
    • $DEVKITPRO correctly set to /opt/devkitpro.
    • $PATH correctly includes /opt/devkitpro/devkitA64/bin and /opt/devkitpro/tools/bin.
    • (Also ensured ~/.bash_profile was correctly configured for permanent PATH settings from previous troubleshooting, though the 3.0.2 installer handled this correctly for new shells).
  6. Final Test with Pristine Example (devkitPro 3.0.2, Correct PATH):
    • Compiled $DEVKITPRO/examples/switch/templates/application.
    • The resulting application.nro still crashes on the Switch with the identical error signature.

Current MSYS2 Shell Environment Output (Fresh Shell from devkitPro 3.0.2 Install)

Code: Select all

$ echo $DEVKITPRO
/opt/devkitpro

$ echo $PATH
/opt/devkitpro/devkitA64/bin:/opt/devkitpro/tools/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

$ aarch64-none-elf-gcc --version
aarch64-none-elf-gcc.exe (devkitA64 release 28) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Core Question / Request for Help

Given the extensive troubleshooting across multiple machines with clean installations, and the fact that the devkitPro 3.0.2 installer now correctly sets up the MSYS2 environment, the persistent and identical crash signature (+0x9844 / +0xc4) in pristine official examples strongly suggests an issue with the devkitA64 r28 (GCC 15.1.0) toolchain itself or its interaction with the libnx startup files (crt0.s, switch.specs).

Could this be a known issue with this specific toolchain version, particularly in a Windows 11 Pro 24H2 environment? The "Copyright 2025" for GCC 15.1.0 also seems unusual. Are there any further diagnostic steps I could take, or suggestions for how to obtain a working build environment that produces stable NROs?

Any assistance or insight would be greatly appreciated, as this is currently a complete blocker for any Switch homebrew development.

Thank you for your time and effort.



Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest