fix(npcppwebapi): preserve aliased inputs during growth #9612

Merged
Ondra97 merged 3 commits from upstream-pr/9612 into main 2026-10-29 05:49:29 +00:00
Ondra97 commented 2026-10-22 04:30:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T04:30:22Z.


What

A Common::Vector can receive a reference to one of its own elements. Growing it with realloc may free that element before pushBack reads it. Common::String::append also read an aliased source after freeing its buffer during growth, and used memcpy for overlapping in-place appends.

Capture an intrusive pointer and deep-copy a string before vector growth, releasing the temporary string if growth fails. Append into the new allocation before freeing the old buffer, and use memmove for in-place appends.

The main update preserves the complete current GuestNpCppWebApiIntrusivePtr.cpp test coverage, including TestUserProfileVectorAssign and TestUserProfileModelAndTransaction, alongside the unchanged TestVectorAliasedGrowth regression and its alias-vector dispatch. #8959 and #9015 are both merged into the base.

For the shared test insertion point, #11631 lands first. After it lands, #9612 will incorporate current main, preserve both PRs' tests, and rerun the focused validation. That integration is pending; the results below describe the existing tested head.

The existing host-owned layout is attributed in repository debt to the module bundled with PPSA21564. Console alias handling remains unmeasured.

Tested

Upstream base 8787ae1bb390b97ada6b4304fdb7c2f43318bb47; tested PR head 7f046f0baa7f86c5b2cfbdba8f9c683b47718917. The branch incorporates main through ordinary merge commits.

Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, RTX 4070 Ti SUPER; WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release, BUILD_TESTING=ON, pinned bundled dependencies. These tests use the CPU.

  • Built relinker, libs, patched_libraries_tests, guest_np_cpp_web_api_intrusive_ptr_tests, guest_np_cpp_web_api_string_tests, guest_np_cpp_web_api_signed_out_tests and guest_np_cpp_web_api_offline_tests with cmake --build <build> --target <targets> --parallel 8.
  • ctest --test-dir <build> -R '^(guest_np_cpp_web_api.*|patched_libraries)$' -V --output-on-failure --no-tests=error --repeat until-fail:3: 8/8 passed in all three repetitions, zero skips. Each library-load check loaded 368 patched libraries, with zero failures. Append checked 762 cases and 256 growths with zero corrupt results; the vector regressions each checked 500 insertions, with 17 string-vector moves and 12 intrusive-vector moves per run.
  • ctest --test-dir <build> -R '^public_headers($|_compile_)' -j 4 --output-on-failure --no-tests=error: 65/65 passed, zero skips.

Linux evidence and the paired controls are recorded in the exact-head verification run. The workflow checks out 7f046f0baa7f86c5b2cfbdba8f9c683b47718917; its definition is kept on a separate verification branch.

Both GitHub-hosted Linux runners: Ubuntu 24.04.5 LTS x86_64, AMD EPYC 7763, approximately 15 GiB visible RAM, GCC 14.2.0, CMake 3.31.6, Ninja, CPU fixtures. Release uses -DCMAKE_BUILD_TYPE=Release -DANYPS5_ENABLE_ASAN=OFF; ASan uses -DCMAKE_BUILD_TYPE=RelWithDebInfo -DANYPS5_ENABLE_ASAN=ON. Both configurations use BUILD_TESTING=ON and the pinned bundled dependencies. Each passed 7/7 tests in all three repetitions, zero skips. The fixed and restored ASan runs reported no sanitizer errors.

All seven guest_np_cpp_web_api* tests, including the main UserProfile cases and all three aliasing modes, are built explicitly. Each configuration runs ctest --test-dir build -R '^guest_np_cpp_web_api' -V --output-on-failure --no-tests=error --repeat until-fail:3. The paired control keeps the identical tests and replaces only Export.cpp with base 8787ae1bb3, rebuilds the library, and invokes each aliasing test through its registered CTest entry. The fixed source is restored, rebuilt and all seven tests run again.

Test Before (base, ASan) After (fix, ASan)
guest_np_cpp_web_api_alias_append fails: memcpy-param-overlap passes
guest_np_cpp_web_api_alias_string_vector fails: heap-use-after-free passes
guest_np_cpp_web_api_alias_intrusive_vector fails: heap-use-after-free passes

In the matching Linux Release control, append failed, the string-vector test aborted, and the intrusive-vector test passed. All seven tests passed again after restoring the fix in each configuration. These are correctness checks, with no speed claim.

The intrusive-vector Release negative control depends on the allocator and heap layout. A passing uninstrumented control does not prove the original read from freed storage was safe; ASan supplies the memory-error check. This update preserves the original regression without claiming to make its Release failure deterministic.

tools/check_conventions.py --base origin/main, tools/check_main_sync.py --base origin/main --strict, git diff origin/main HEAD --check and tools/check_test_registration.py <build> pass. The Windows registration audit counts 1,447 test executables; the executed runtime checks are listed above.

tools/pr_overlap.py completed. #11631 shares the test-entry insertion context while adding separate UserProfile functionality; it does not implement these aliasing fixes. #11475's uncomparable CMake edit only adds MissingExports.cpp to the library source list, separately from this PR's test registrations. Both were inspected manually. The final main refresh leaves these shared files unchanged.

No full CTest suite, title or console execution is claimed.

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 under Silent stubs in their library's technical debt file
  • 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: #11631
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4962121775 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-22T04:30:22Z. --- ### What A `Common::Vector` can receive a reference to one of its own elements. Growing it with `realloc` may free that element before `pushBack` reads it. `Common::String::append` also read an aliased source after freeing its buffer during growth, and used `memcpy` for overlapping in-place appends. Capture an intrusive pointer and deep-copy a string before vector growth, releasing the temporary string if growth fails. Append into the new allocation before freeing the old buffer, and use `memmove` for in-place appends. The main update preserves the complete current `GuestNpCppWebApiIntrusivePtr.cpp` test coverage, including `TestUserProfileVectorAssign` and `TestUserProfileModelAndTransaction`, alongside the unchanged `TestVectorAliasedGrowth` regression and its `alias-vector` dispatch. #8959 and #9015 are both merged into the base. For the shared test insertion point, #11631 lands first. After it lands, #9612 will incorporate current main, preserve both PRs' tests, and rerun the focused validation. That integration is pending; the results below describe the existing tested head. The existing host-owned layout is attributed in repository debt to the module bundled with PPSA21564. Console alias handling remains unmeasured. ### Tested Upstream base `8787ae1bb390b97ada6b4304fdb7c2f43318bb47`; tested PR head `7f046f0baa7f86c5b2cfbdba8f9c683b47718917`. The branch incorporates main through ordinary merge commits. Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, RTX 4070 Ti SUPER; WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release, `BUILD_TESTING=ON`, pinned bundled dependencies. These tests use the CPU. - Built `relinker`, `libs`, `patched_libraries_tests`, `guest_np_cpp_web_api_intrusive_ptr_tests`, `guest_np_cpp_web_api_string_tests`, `guest_np_cpp_web_api_signed_out_tests` and `guest_np_cpp_web_api_offline_tests` with `cmake --build <build> --target <targets> --parallel 8`. - `ctest --test-dir <build> -R '^(guest_np_cpp_web_api.*|patched_libraries)$' -V --output-on-failure --no-tests=error --repeat until-fail:3`: **8/8 passed in all three repetitions, zero skips**. Each library-load check loaded 368 patched libraries, with zero failures. Append checked 762 cases and 256 growths with zero corrupt results; the vector regressions each checked 500 insertions, with 17 string-vector moves and 12 intrusive-vector moves per run. - `ctest --test-dir <build> -R '^public_headers($|_compile_)' -j 4 --output-on-failure --no-tests=error`: **65/65 passed**, zero skips. Linux evidence and the paired controls are recorded in the [exact-head verification run](https://github.com/Ondra97/AnyPS5/actions/runs/40467193291). The workflow checks out `7f046f0baa7f86c5b2cfbdba8f9c683b47718917`; its definition is kept on a separate verification branch. Both GitHub-hosted Linux runners: Ubuntu 24.04.5 LTS x86_64, AMD EPYC 7763, approximately 15 GiB visible RAM, GCC 14.2.0, CMake 3.31.6, Ninja, CPU fixtures. Release uses `-DCMAKE_BUILD_TYPE=Release -DANYPS5_ENABLE_ASAN=OFF`; ASan uses `-DCMAKE_BUILD_TYPE=RelWithDebInfo -DANYPS5_ENABLE_ASAN=ON`. Both configurations use `BUILD_TESTING=ON` and the pinned bundled dependencies. **Each passed 7/7 tests in all three repetitions, zero skips.** The fixed and restored ASan runs reported no sanitizer errors. All seven `guest_np_cpp_web_api*` tests, including the main UserProfile cases and all three aliasing modes, are built explicitly. Each configuration runs `ctest --test-dir build -R '^guest_np_cpp_web_api' -V --output-on-failure --no-tests=error --repeat until-fail:3`. The paired control keeps the identical tests and replaces only `Export.cpp` with base `8787ae1bb3`, rebuilds the library, and invokes each aliasing test through its registered CTest entry. The fixed source is restored, rebuilt and all seven tests run again. | Test | Before (base, ASan) | After (fix, ASan) | | --- | --- | --- | | `guest_np_cpp_web_api_alias_append` | fails: `memcpy-param-overlap` | passes | | `guest_np_cpp_web_api_alias_string_vector` | fails: `heap-use-after-free` | passes | | `guest_np_cpp_web_api_alias_intrusive_vector` | fails: `heap-use-after-free` | passes | In the matching Linux Release control, append failed, the string-vector test aborted, and the intrusive-vector test passed. All seven tests passed again after restoring the fix in each configuration. These are correctness checks, with no speed claim. The intrusive-vector Release negative control depends on the allocator and heap layout. A passing uninstrumented control does not prove the original read from freed storage was safe; ASan supplies the memory-error check. This update preserves the original regression without claiming to make its Release failure deterministic. `tools/check_conventions.py --base origin/main`, `tools/check_main_sync.py --base origin/main --strict`, `git diff origin/main HEAD --check` and `tools/check_test_registration.py <build>` pass. The Windows registration audit counts 1,447 test executables; the executed runtime checks are listed above. `tools/pr_overlap.py` completed. #11631 shares the test-entry insertion context while adding separate UserProfile functionality; it does not implement these aliasing fixes. #11475's uncomparable CMake edit only adds `MissingExports.cpp` to the library source list, separately from this PR's test registrations. Both were inspected manually. The final main refresh leaves these shared files unchanged. No full CTest suite, title or console execution is claimed. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: <!-- #PR, or none --> #11631 - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
jotitadev commented 2026-10-22 04:49:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T04:49:37Z.

Review: COMMENTED


Linux run with and without ASan. The fix passes both ways. Without ASan, the base results on Linux differ from the Windows table in both directions, and one of the two vector regressions passes on base under ctest.

Machine: Linux x86_64, i7-8700, Ubuntu 26.04 (kernel 7.0.0-38), GCC 15.2 / glibc. Head 51ac98e7e merged --no-commit onto main 17f533556 (clean). Release build, plus a separate -DANYPS5_ENABLE_ASAN=ON RelWithDebInfo build of the two test targets.

  • With the PR: the five guest_np_cpp_web_api* tests pass, both in Release and under ASan.

  • Base Export.cpp under ASan: all three new tests abort, each at the line the PR changes:

    • alias_intrusive_vector: heap-use-after-free, READ of size 24 in VectorPushBackIntrusivePtr (Export.cpp:869, elements[body->size] = *element).
    • alias_string_vector: heap-use-after-free, READ of size 32 in VectorPushBackString (Export.cpp:879, the copy after VectorGrow).
    • alias_append: memcpy-param-overlap at Export.cpp:1068 (the in-place path). With only that line switched to memmove, the next report is heap-use-after-free on the growth path: the freed self->buffer is read at line 1068 after the free at line 1064.
  • Base Export.cpp, Release, no ASan (glibc):

    • alias_append fails: 762 cases, 256 growths, 83 corrupt results. On Linux the freed buffer is reused, so the append test does catch it here. On Windows it passed 762/762.
    • alias_string_vector aborts, as on Windows.
    • alias_intrusive_vector passes under ctest (30/30 with --repeat until-fail:30). It aborts at GuestNpCppWebApiIntrusivePtr.cpp:300 every time it is run from build/tests or /tmp. The only difference is the ctest WORKING_DIRECTORY (build/core/libs/prx/libSceNpCppWebApi). The cwd length changes the heap layout, so the stale old elements are still intact when they are read.

    So on Linux, the intrusive-vector regression's red depends on where the binary runs. Under ctest it doesn't detect a revert, and only ASan makes it deterministic.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609396200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612#pullrequestreview-5609396200). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-22T04:49:37Z. **Review:** COMMENTED --- Linux run with and without ASan. The fix passes both ways. Without ASan, the base results on Linux differ from the Windows table in both directions, and one of the two vector regressions passes on base under ctest. Machine: Linux x86_64, i7-8700, Ubuntu 26.04 (kernel 7.0.0-38), GCC 15.2 / glibc. Head `51ac98e7e` merged `--no-commit` onto `main` `17f533556` (clean). Release build, plus a separate `-DANYPS5_ENABLE_ASAN=ON` RelWithDebInfo build of the two test targets. - **With the PR:** the five `guest_np_cpp_web_api*` tests pass, both in Release and under ASan. - **Base `Export.cpp` under ASan:** all three new tests abort, each at the line the PR changes: - `alias_intrusive_vector`: heap-use-after-free, READ of size 24 in `VectorPushBackIntrusivePtr` (`Export.cpp:869`, `elements[body->size] = *element`). - `alias_string_vector`: heap-use-after-free, READ of size 32 in `VectorPushBackString` (`Export.cpp:879`, the copy after `VectorGrow`). - `alias_append`: `memcpy-param-overlap` at `Export.cpp:1068` (the in-place path). With only that line switched to `memmove`, the next report is heap-use-after-free on the growth path: the freed `self->buffer` is read at line 1068 after the `free` at line 1064. - **Base `Export.cpp`, Release, no ASan (glibc):** - `alias_append` **fails**: `762 cases, 256 growths, 83 corrupt results`. On Linux the freed buffer is reused, so the append test does catch it here. On Windows it passed 762/762. - `alias_string_vector` aborts, as on Windows. - `alias_intrusive_vector` **passes under ctest** (30/30 with `--repeat until-fail:30`). It aborts at `GuestNpCppWebApiIntrusivePtr.cpp:300` every time it is run from `build/tests` or `/tmp`. The only difference is the ctest `WORKING_DIRECTORY` (`build/core/libs/prx/libSceNpCppWebApi`). The cwd length changes the heap layout, so the stale old elements are still intact when they are read. So on Linux, the intrusive-vector regression's red depends on where the binary runs. Under ctest it doesn't detect a revert, and only ASan makes it deterministic. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-22 09:29:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:29:54Z.

Review: APPROVED


The aliasing fixes are well targeted: VectorPushBackIntrusivePtr captures the element before growth, VectorPushBackString deep-copies before growth and frees the copy on allocation failure, and String::append copies into the new allocation before freeing the old one while using memmove for overlapping in-place sources. The test additions cover all vector source indices over repeated growth and append offsets/boundaries.

Exact-head git diff --check and python -I tools/check_conventions.py --base upstream/main --head HEAD pass. Hosted conventions, eligibility, labels, and progress report pass; product Linux/Windows jobs are skipped. The author reports Windows current-main red/green tests and a full selected suite, and an independent Linux reviewer reports passing release and ASan tests plus useful negative-control analysis. I attempted local exact-head configuration, but CMake generation stops because 3rdparty/vgmstream is uninitialized (atrac9_dec.c is missing), so I did not rerun runtime tests.

Please retain the current Depends on: #8959, #9015 coordination and land/rebase in that order if their shared test setup requires it. The independent Linux report found the intrusive-pointer negative test passes under CTest on base due to working-directory-dependent heap layout, though it fails when run directly and is caught under ASan. Consider making the regression deterministic under the registered CTest invocation before relying on it as a future regression guard. Also keep the final test summary scoped: the stated 1,173 registered executables is a registration count, while the seven selected runtime tests and 367-library load check are the executed checks.

The current-main issue and paired negative controls justify this generic correctness fix despite the general intake hold. Fixes: none and Unblocks: none are appropriate because this is not tied to a title stop.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5612079420 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612#pullrequestreview-5612079420). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T09:29:54Z. **Review:** APPROVED --- The aliasing fixes are well targeted: `VectorPushBackIntrusivePtr` captures the element before growth, `VectorPushBackString` deep-copies before growth and frees the copy on allocation failure, and `String::append` copies into the new allocation before freeing the old one while using `memmove` for overlapping in-place sources. The test additions cover all vector source indices over repeated growth and append offsets/boundaries. Exact-head `git diff --check` and `python -I tools/check_conventions.py --base upstream/main --head HEAD` pass. Hosted conventions, eligibility, labels, and progress report pass; product Linux/Windows jobs are skipped. The author reports Windows current-main red/green tests and a full selected suite, and an independent Linux reviewer reports passing release and ASan tests plus useful negative-control analysis. I attempted local exact-head configuration, but CMake generation stops because `3rdparty/vgmstream` is uninitialized (`atrac9_dec.c` is missing), so I did not rerun runtime tests. Please retain the current `Depends on: #8959, #9015` coordination and land/rebase in that order if their shared test setup requires it. The independent Linux report found the intrusive-pointer negative test passes under CTest on base due to working-directory-dependent heap layout, though it fails when run directly and is caught under ASan. Consider making the regression deterministic under the registered CTest invocation before relying on it as a future regression guard. Also keep the final test summary scoped: the stated 1,173 registered executables is a registration count, while the seven selected runtime tests and 367-library load check are the executed checks. The current-main issue and paired negative controls justify this generic correctness fix despite the general intake hold. `Fixes: none` and `Unblocks: none` are appropriate because this is not tied to a title stop.
MarcZX10 commented 2026-10-22 13:15:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T13:15:58Z.

Review: CHANGES_REQUESTED


The implementation and aliasing regressions remain well supported by the Windows red/green report and the independent Linux Release/ASan results; my prior code approval still stands. I refreshed exact head 71138a2642380b6068e4a2a6699c93cf0c1501a3 against current main 3ca07d086d5f44fbe3c00370e7f03953ab46ca1b: whitespace and conventions pass, and the current-main merge tree is clean.

The branch currently includes main only through d6eafa54d0464258574fd2f71889754d05a5bc93; the repository requires keeping branches up to date. Please update it to current main and refresh the focused aliasing/ASan checks on the resulting head. I did not rerun runtime tests locally; hosted full product jobs are skipped. The earlier intake objection is withdrawn; this review request is only for the current-main update and refreshed test record.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614806379 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612#pullrequestreview-5614806379). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T13:15:58Z. **Review:** CHANGES_REQUESTED --- The implementation and aliasing regressions remain well supported by the Windows red/green report and the independent Linux Release/ASan results; my prior code approval still stands. I refreshed exact head `71138a2642380b6068e4a2a6699c93cf0c1501a3` against current main `3ca07d086d5f44fbe3c00370e7f03953ab46ca1b`: whitespace and conventions pass, and the current-main merge tree is clean. The branch currently includes main only through `d6eafa54d0464258574fd2f71889754d05a5bc93`; the repository requires keeping branches up to date. Please update it to current main and refresh the focused aliasing/ASan checks on the resulting head. I did not rerun runtime tests locally; hosted full product jobs are skipped. The earlier intake objection is withdrawn; this review request is only for the current-main update and refreshed test record.
jotitadev commented 2026-10-27 03:14:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T03:14:25Z.

Review: COMMENTED


Re-ran the Release control from my earlier review on the current head 0f998c157. The intrusive-vector gap I reported is still there on Linux. GuestNpCppWebApiIntrusivePtr.cpp's TestVectorAliasedGrowth and the test registration are unchanged since 51ac98e7e.

Machine: Linux x86_64, i7-8700, Ubuntu 26.04, glibc 2.43, GCC 15.2, Release, BUILD_TESTING=ON, full build. Head 0f998c157 merged --no-commit onto main abed03546. The one conflict, in GuestNpCppWebApiIntrusivePtr.cpp, is two independent additions: I kept main's TestUserProfile* functions and the PR's TestVectorAliasedGrowth with main(argc, argv).

  • With the PR: the 7 guest_np_cpp_web_api* tests pass, 3/3.
  • Control, Export.cpp from main with the tests kept:
    • guest_np_cpp_web_api_alias_append fails, and guest_np_cpp_web_api_alias_string_vector aborts.
    • guest_np_cpp_web_api_alias_intrusive_vector passes under ctest, 30/30 with --repeat until-fail:30. The same binary run as ./guest_np_cpp_web_api_intrusive_ptr_tests alias-vector from build/tests aborts 3/3.

@blawesom's Release run on Arch/Ryzen does show this test failing on the parent. Here, under ctest, it doesn't. So in a Release run without ASan, whether reverting the VectorPushBackIntrusivePtr fix gets caught still depends on the host's heap layout. With ASan it is caught every time, in both of our runs.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661810013 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612#pullrequestreview-5661810013). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T03:14:25Z. **Review:** COMMENTED --- Re-ran the Release control from my earlier review on the current head `0f998c157`. The intrusive-vector gap I reported is still there on Linux. `GuestNpCppWebApiIntrusivePtr.cpp`'s `TestVectorAliasedGrowth` and the test registration are unchanged since `51ac98e7e`. Machine: Linux x86_64, i7-8700, Ubuntu 26.04, glibc 2.43, GCC 15.2, Release, `BUILD_TESTING=ON`, full build. Head `0f998c157` merged `--no-commit` onto `main` `abed03546`. The one conflict, in `GuestNpCppWebApiIntrusivePtr.cpp`, is two independent additions: I kept `main`'s `TestUserProfile*` functions and the PR's `TestVectorAliasedGrowth` with `main(argc, argv)`. - With the PR: the 7 `guest_np_cpp_web_api*` tests pass, 3/3. - Control, `Export.cpp` from `main` with the tests kept: - `guest_np_cpp_web_api_alias_append` fails, and `guest_np_cpp_web_api_alias_string_vector` aborts. - `guest_np_cpp_web_api_alias_intrusive_vector` **passes** under ctest, 30/30 with `--repeat until-fail:30`. The same binary run as `./guest_np_cpp_web_api_intrusive_ptr_tests alias-vector` from `build/tests` aborts 3/3. @blawesom's Release run on Arch/Ryzen does show this test failing on the parent. Here, under ctest, it doesn't. So in a Release run without ASan, whether reverting the `VectorPushBackIntrusivePtr` fix gets caught still depends on the host's heap layout. With ASan it is caught every time, in both of our runs. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-28 22:24:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:24:21Z.

Review: CHANGES_REQUESTED


The aliasing fixes remain well supported: intrusive pointers are captured before growth, strings are copied before growth with cleanup on failure, and overlapping in-place appends use memmove. The author reports repeated Windows tests and an independent Linux Release/ASan red/green run on the tested merge tree. I did not rerun the suite locally; hosted product jobs are skipped.

The current overlap report adds #11631 in GuestNpCppWebApiIntrusivePtr.cpp at the same test insertion point. This PR's checklist still says Depends on: none, and I found no agreement in the thread on which test change lands first. Please coordinate with #11631's author, record the agreed landing order in both checklists, and refresh the affected test file on the resulting base. This follows the repository's overlap rule; the aliasing implementation itself has no new blocker.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5690483913 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9612#pullrequestreview-5690483913). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T22:24:21Z. **Review:** CHANGES_REQUESTED --- The aliasing fixes remain well supported: intrusive pointers are captured before growth, strings are copied before growth with cleanup on failure, and overlapping in-place appends use `memmove`. The author reports repeated Windows tests and an independent Linux Release/ASan red/green run on the tested merge tree. I did not rerun the suite locally; hosted product jobs are skipped. The current overlap report adds #11631 in `GuestNpCppWebApiIntrusivePtr.cpp` at the same test insertion point. This PR's checklist still says `Depends on: none`, and I found no agreement in the thread on which test change lands first. Please coordinate with #11631's author, record the agreed landing order in both checklists, and refresh the affected test file on the resulting base. This follows the repository's overlap rule; the aliasing implementation itself has no new blocker.
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!9612
No description provided.