Repository navigation
Conversation
pthread_exit had no test, although scePthreadExit it forwards to is covered. Check the FreeBSD 11.4 behaviour of _pthread_exit (lib/libthr/thread/thr_exit.c lines 204-290): the value passed to pthread_exit is returned by pthread_join (also NULL), code after the call never runs, the cleanup handlers of the thread run once and before the thread-specific data destructors, and a key destructor runs once with the stored value. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed head 0c84414. The change is test-only and exercises the public pthread_exit wrapper through join result propagation (including nullptr), non-return, cleanup-handler execution/order, and key destructor value/count. I inspected the test and CMake registration; the 30-second timeout and Windows libkernel runtime PATH match neighboring guest tests. The exact PR head merges cleanly with current upstream/main, and the required stack (#11500, #10979, #11799, #11894) is open with clean merge states and the landing order is declared. GitHub Windows CI compiled/linked the test target but did not run CTest; Linux is skipped. I did not independently execute this test. The repeated Windows and WSL runs and mutation checks in the PR description are contributor-reported evidence, so this approval relies on that report plus source review, not on those runs being independently verified here.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
AI-assisted (Claude Code). |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 1a00487af998c6955c1fc7da55a8290b2e2a5665 against 6e9b9134f6ed14e659d870a33118d164096551df. The new pthread_exit fixture checks both null and non-null join values, nonreturning exit, a single cleanup handler followed by the TLS destructor, and the stored destructor argument. Each worker is joined before the global test context is reused. No actionable finding in this scoped test review.
Windows/GCC 15.3 Release: configured and built the registered target from pinned sources; focused CTest: 1 passed, 0 skipped. Checked that the fixture assertions remain active in Release. The added target is absent from the author base; no baseline runtime execution of that new fixture is claimed. Production source and the changed test-registration blocks were source-compared. Matching cached dependency source pins and the existing matching FFmpeg package are used. No game, physical-console or GPU validation is claimed.
What
Adds
guest_posix_exit, a behaviour test forpthread_exit. The export forwards toscePthreadExit, which other tests cover, but no test calledpthread_exititself. The expected results come from FreeBSD 11.4lib/libthr/thread/thr_exit.c(_pthread_exitand_pthread_exit_mask):pthread_joinreturns the value passed topthread_exit, and NULL when NULL is passed;pthread_exitnever runs;No production code changes. There is no failing arm on
main: this is coverage of an existing export.Tested
0c844143cconmaind13b3d7c55(ninja exit code 0):guest_posix_exitpasses 3 of 3 runs (the longest run takes 0.6 s). The head before the rebase onto thismain,089c4d763bonmain14332cd8d0, passed 25 of 25 runs (5 plus 20 more as a check for flakiness; the longest run takes 0.85 s); the rebase did not touch the files of this PR.0c844143cc(ninja exit code 0): passes 3 of 3 runs (5 of 5 on089c4d763b).guest_posix_exitpassed 10 of 10 runs, and withpthread_exitpassingnullptrit failed 3 of 3 runs at "join returns the value passed to pthread_exit"; on Ubuntu 24.04 under WSL2 (a virtualised kernel, not bare-metal) it passed 5 of 5 runs. The failing arm was not run on WSL2.pthread_exitpassingnullptr(Pthread/Posix/Thread.cppline 164; "join returns the value passed to pthread_exit");pthread_exitreturning without ending the thread (line 164; "code after pthread_exit never runs");scePthreadExitwithout popping the cleanup handlers (Pthread/src/Thread.cppline 1155; "the cleanup handler runs once on pthread_exit");finishThreadstoring no return value (line 731; "join returns the value passed to pthread_exit"); the cleanup handlers popped afterfinishThread(lines 1155-1156; "the cleanup handler runs before the key destructor"); and the key destructors never run (Pthread/src/Tsd.cppline 44; "the key destructor runs once on pthread_exit"). Removing theRunKeyDtorscall infinishThread(line 728) does not fail the test, because the key destructors also run throughTsd.cpp.check_conventions --base upstream/mainpasses, andgit merge-treeagainstmaind13b3d7c55is clean.pthread_exiton a host thread or the main thread.Overlap
No open PR adds a test for
pthread_exit;git greponmainfinds no test that calls it. Of the 1358 open PRs, 70 changecore/libs/prx/libkernel/CMakeLists.txt,Pthread/Posix/Thread.cpp,Pthread/src/Thread.cppor this test.git merge-treeof the head before the rebase (onmain14332cd8d0; the rebase touched none of these files) with each of them conflicts for 25; 21 of those already conflict withmainon their own. Aftermaintook theguest_posix_specificblock, the test blocks of #11500, #10979, this PR and #11894 sit in different places inlibkernel/CMakeLists.txt, andgit merge-treeof each pair is clean (heads #11500 (b8685f7), #10979 (1a2cff7), #11894 (5a2d89e) and this head1a00487af9); no landing order is needed.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