feat(libc): implement _Mtx_init_with_name #4918

Merged
Feuris merged 1 commit from upstream-pr/4918 into main 2026-10-13 08:30:44 +00:00
Feuris commented 2026-10-13 04:07:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Feuris on 2026-10-13T04:07:30Z.


What

Implement _Mtx_init_with_name in libc, forwarding to _Mtx_init and ignoring the mutex name parameter.

On main, Super Meat Boy 3D (PPSA31162) stops on startup with:

FAIL: unresolved ELF import tgioGpKtmbE from libc.prx

FATAL: unhandled exception 0xc0000005 on thread 9848 ''
  rip 0x00007ffda22c3ca7 ntdll.dll+0x123ca7

Export tgioGpKtmbE matches aerolib symbol _Mtx_init_with_name.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0: Unit test guest_libc_mutex_init_with_name verifies initialization with name parameter, lock/unlock, destruction and null handle validation.
  • PPSA31162 (Super Meat Boy 3D): unblocks startup stop at unresolved import tgioGpKtmbE.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA31162
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4838219201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4918). Originally posted by [Feuris](https://github.com/Feuris) on 2026-10-13T04:07:30Z. --- ### What Implement `_Mtx_init_with_name` in libc, forwarding to `_Mtx_init` and ignoring the mutex name parameter. On main, Super Meat Boy 3D (`PPSA31162`) stops on startup with: ``` FAIL: unresolved ELF import tgioGpKtmbE from libc.prx FATAL: unhandled exception 0xc0000005 on thread 9848 '' rip 0x00007ffda22c3ca7 ntdll.dll+0x123ca7 ``` Export `tgioGpKtmbE` matches aerolib symbol `_Mtx_init_with_name`. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0: Unit test `guest_libc_mutex_init_with_name` verifies initialization with name parameter, lock/unlock, destruction and null handle validation. - PPSA31162 (Super Meat Boy 3D): unblocks startup stop at unresolved import `tgioGpKtmbE`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA31162 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 04:14:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T04:14:05Z.


Progress report (e51428b → ab4ccad)

📈 System libraries: 87.93% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libc _Mtx_init_with_name_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6138084184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4918#issuecomment-6138084184). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T04:14:05Z. --- <!-- progress-report --> ### Progress report (e51428b → ab4ccad) 📈 **System libraries**: 87.93% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libc | `_Mtx_init_with_name_nid_postfix` | </details>
xXPBSXx commented 2026-10-13 06:15:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T06:15:35Z.


Windows test: head ab4ccade2 merged onto current main 7e181fcc3 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest with the filter guest_libc_mutex_init_with_name: guest_libc_mutex_init_with_name passed (1 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6139507637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4918#issuecomment-6139507637). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T06:15:35Z. --- Windows test: head `ab4ccade2` merged onto current `main` `7e181fcc3` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest with the filter `guest_libc_mutex_init_with_name`: guest_libc_mutex_init_with_name passed (1 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
adriadam10 commented 2026-10-13 08:30:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T08:30:40Z.


Checked on Linux: the PR merged onto main builds, scoped ctest is green (90/90), and guest_libc_mutex_init_with_name passes and fails to link without the change. NID tgioGpKtmbE matches _Mtx_init_with_name, the TechnicalDebt entry is in place, and xXPBSXx's Windows run covers MinGW. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141548075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4918#issuecomment-6141548075). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T08:30:40Z. --- Checked on Linux: the PR merged onto main builds, scoped ctest is green (90/90), and `guest_libc_mutex_init_with_name` passes and fails to link without the change. NID `tgioGpKtmbE` matches `_Mtx_init_with_name`, the TechnicalDebt entry is in place, and xXPBSXx's Windows run covers MinGW. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4918
No description provided.