test(libSceNKWebKit): let nkwebkit_wtf see null from an impossible allocation under ASan #15003
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15003"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-02T09:25:30Z.
What
The test
nkwebkit_wtfwas added with #13500 on 2026-10-31 at 11:18 UTC, after that night's nightly run; it failed in the nightly Sanitizers runs of 2026-11-01 and 2026-11-02. It asksWTF::tryFastMallocformaxSize - 64bytes and expectsnullptr.NKWebKit::PlaceAllocationpasses that request on tostd::malloc; glibc returns NULL for it, but the ASan allocator aborts instead ("requested allocation size 0xffffffffffffffdf exceeds maximum supported size of 0x10000000000") becauseallocator_may_return_nulldefaults to 0.This PR appends
allocator_may_return_null=1to the test'sASAN_OPTIONS, only fornkwebkit_wtfand only in ASan builds. It usesENVIRONMENT_MODIFICATIONwithpath_list_append, so thedetect_leaks=0that the nightly sets insanitizers.ymlis kept. Withoutallocator_may_return_null=1the nightly options abort the test, because ASan aborts on the deliberately unsatisfiable size before the test can see the null result.A product ceiling in
PlaceAllocationis deliberately not added: it already refuses sizes aboveSIZE_MAX - slack(#13500), and the test expects exactly the null result the code returns.Changes one file,
core/libs/prx/libSceNKWebKit/CMakeLists.txt(+4).Tested
ASAN_OPTIONS=detect_leaks=0as in the nightly, 08:18 UTC to 08:19 UTC.nkwebkit_wtfPassed in 3 of 3 runs.python -I tools/check_conventions.py --base 4569fe654a97dbcc07d9e76dd22a6099f3408ab5passed at 08:21 UTC;git diff --checkclean.CMakeLists.txt:114).Overlap
Checked against main
4569fe654awith the 1914 open PRs listed at 07:29 UTC. Five PRs change this file (#14949, #14932, #14931, #14172, #13766);git merge-treeof each against this head is clean (08:21 UTC). The block sits inside the test loop afteradd_test, not afterendforeach(), because the latter position conflicted with #14172. #13454 had no fetchable ref; its file list (3 files, read through the API at 08:22 UTC) does not include this file. Rechecked on 2026-11-02 at 09:24 UTC: this head merges withmain88e804b0a7without a conflict, and none of the 18 pull requests opened since 07:40 UTC (#14980 to #15002) changes this file. Depends on: none.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)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T12:01:06Z.
Review: APPROVED
Looks right to me for the sanitizer job.
path_list_appendon Linux joins with:, which is alsoASAN_OPTIONS's separator, so the nightly'sdetect_leaks=0survives andallocator_may_return_null=1is added. WithASAN_OPTIONSunset, the value is just the new flag. Scoping it tonkwebkit_wtfin ASan builds keeps every other test's allocator behaviour strict.One non-blocking point: on
WIN32, theset_tests_properties(... ENVIRONMENT_MODIFICATION "PATH=...")just below replaces the property rather than adding to it, so in an ASan build on Windows the new entry would be dropped. ASan isn't built on Windows today, so nothing breaks.set_property(TEST nkwebkit_${testName} APPEND PROPERTY ENVIRONMENT_MODIFICATION "ASAN_OPTIONS=path_list_append:allocator_may_return_null=1")would make the order irrelevant, though.I couldn't run it: this machine has no ASan toolchain (Windows/MinGW). This review is from the CMake semantics and your Ubuntu runs and their control.