Repository navigation
feat(libc): add ios_base::failure constructors - #28897
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Feature Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The changed code and tests support the described behavior, but console exports and behavior have not been verified.
What I ran
Reviewed head b28afd4581411a187b319c051e01633d7188f301 from the prepared diff and file copies. The repository reader search could not run because it tried to write its call log in the read-only review folder. No tests or builds were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed lines | passed | All five changed files reviewed |
| Tests and build | not run | No execution performed |
| Console verification | not run | Exporting module and behavior unchecked |
Findings
Blocking
None.
Non-blocking
core/libs/prx/libc/src/exception/StandardExceptions.cpp:685adds behavior for a console ABI whose implementation and exporting module the author says were not checked. The debt entry records this gap; the implementation is supported by the sharedsystem_errorconstructor and the included host test, but console compatibility remains unverified.
Not verified
No tests, build, console run, or console export/module inspection was performed. Read the changed lines and relevant context in all five reviewed files: core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/src/exception/StandardExceptions.cpp, core/libs/prx/libc/tests/cmake/guest_ios_failure_constructors.cmake, core/libs/tests/GuestIosFailureConstructors.cpp, and docs/dev/debt/changes/feat-libc-ios-failure-constructors.md. files.json lists no excluded files.
To get this to a good state
Nothing is required. Optional: compare the constructors and exporting module with the console libc or libSceLibcInternal module.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Checked the four shared-file entries by hand before opening: #12682, #12688, #12700 and #12965 are libkernel changes (POSIX read/write/accept cancellation and blocking sockets) whose AI-assisted: yes (Claude Code). |
Plyxen
left a comment
There was a problem hiding this comment.
Verified head b28afd4 on Windows 11 with GCC 15.2, applied to main 484b036.
guest_ios_failure_constructors: passes.- No runtime negative: with the
StandardExceptions.cppandApi.hppchanges reverted, the test does not compile, because the constructors are undeclared.
Read through: C1(const char*, const error_code&) builds a system_error, then switches the vtable to ios_base::failure's. C2 forwards to C1. The copy constructor uses the same LibcException::Copy as the other exception copies and copies code. A null code goes to GuestFault_nid_no_patch, which the debt fragment records.
AI-assisted: yes (Claude Code)
Progress report (8037ad5 → b28afd4)📈 System libraries: 48.03% (+0.0039%, +3 implemented functions) ✅ 3 implemented
Changed libraries (implemented exports)
|
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
Linux x86_64 check (Ubuntu 24.04 container) at head b28afd4, merged into AI-assisted: yes (Claude Code) |
What
Adds three libc exports for
std::ios_base::failure, next to the existingios_base::failuredestructors andwhat:_ZNSt8ios_base7failureC1EPKcRKSt10error_code(2PxU-rB3ixI) and_ZNSt8ios_base7failureC2EPKcRKSt10error_code(xFkYamgQChU):failure(const char*, const error_code&). As in Microsoft STLxiosbase, the object is built throughsystem_error(error_code, const char*), so the message is"<message>: <category message>", or just the category message when the message is empty. This reuses the existing_ZNSt12system_errorC2ESt10error_codePKcpath (LibcExceptionConstructSystemError_nid_no_patch). The constructor then stores theios_base::failurevtable. Theerror_codecomes in by reference, so it arrives as a pointer and is dereferenced. A nullerror_codereference callsGuestFault_nid_no_patch, since the console dereferences it (the input this PR names under the newGuestFaultrule); a null category throwsstd::invalid_argumentfrom the sharedsystem_errorconstructor, as onmain._ZNSt8ios_base7failureC1ERKS0_(igWZiDXnBC0): the copy constructor. It shares the refcounted message and copies the 16-byteerror_code, like the existingsystem_errorcopy constructor.The NIDs are
tools/nid_names.pycompute_nidof each name. I did not check which console module exports these, so this PR adds no libSceLibcInternal forwarders. TheNSt8__sce_v28ios_base7failureEvariants are out of scope. The gap is recorded indocs/dev/debt/changes/feat-libc-ios-failure-constructors.md.Tested
Windows 11, GCC 15.2 (WinLibs UCRT), Ninja Release. The new host test
guest_ios_failure_constructorsis registered incore/libs/prx/libc/tests/cmake/guest_ios_failure_constructors.cmake. It uses a test category whose message is"Invalid argument"and checks:"stream": the type record isNSt8ios_base7failureE,what()isstream: Invalid argument, and the code is{0, 22, &category}. D1 then clears the message."":what()isInvalid argument.what()still works after the source is destroyed, and both messages are null after D1.error_codepointer reachesGuestFault_nid_no_patch(astd::runtime_errornaming the console fault), and a null category throwsstd::invalid_argument.Retested after merging
main87a06f59cf:ctest -R "^(guest_ios_failure_constructors|guest_ampr_cpp_error|guest_filesystem_error)$"passed in each of 3 runs.Red checks:
undefined reference to '_ZNSt8ios_base7failureC1EPKcRKSt10error_code_nid_postfix'.ios_base::failure constructor check 1 failed.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkpass. No title or homebrew was run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit