[PATCH 0/1] MR8292: kernel32/tests: Filter out some CI environment variables.
I see some CI runs fail with this message (e.g. [this run](https://gitlab.winehq.org/bernhardu/wine/-/jobs/164160): ``` ... $ if ($WINETEST_ARGS.count -gt 0) { # collapsed multi-line command Running after_script 00:01 Traceback (most recent call last): File "/home/gitlab-runner/tools/gitlab/virtrunner/qemu-agent.py", line 190, in <module> main() File "/home/gitlab-runner/tools/gitlab/virtrunner/qemu-agent.py", line 179, in main ret = run(virsh, args) File "/home/gitlab-runner/tools/gitlab/virtrunner/qemu-agent.py", line 112, in run print(data.decode("utf-8")) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9a in position 8638: invalid start byte Uploading artifacts for failed job 00:01 ... ``` The artifact [winetest.log](https://gitlab.winehq.org/bernhardu/wine/-/jobs/164160/artifacts/raw/winetes...) from the example above contains this test failures, where these environment variables do no longer match the parent process: ``` process.c:1327:1.000 Test succeeded process.c:1327:1.015 Test failed: Parent-env string CI_COMMIT_AUTHOR=Bernhard Übelacker <bernhardu(a)mailbox.org> isn't in child process process.c:1327:1.421 Test failed: Parent-env string GITLAB_USER_NAME=Bernhard Übelacker isn't in child process process.c:1352:1.687 Test failed: Child-env string CI_COMMIT_AUTHOR=Bernhard sbelacker <bernhardu(a)mailbox.org> isn't in parent process process.c:1352:1.687 Test failed: Child-env string GITLAB_USER_NAME=Bernhard sbelacker isn't in parent process ``` I tried to get some more details and [this testbot run](https://testbot.winehq.org/JobDetails.pl?Key=158611&f201=exe64.report#k201) points to the second CreateProcessA, which is given a specific `child_env` to use for process creation, but does not make it into child process in Windows for some reason. Therefore this patch is an attempt to filter out these known environment variables. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8292
From: Bernhard Übelacker <bernhardu(a)mailbox.org> --- dlls/kernel32/tests/process.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 7984f3d6fb4..12db51bd447 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -1416,11 +1416,16 @@ static void test_Environment(void) ptr += strlen(ptr) + 1; /* copy all existing variables except: * - PATH (already set above) + * - CI_COMMIT_AUTHOR and GITLAB_USER_NAME, which can contain extended ascii character + * depending on the patch creators name, which get in Windows not properly passed + * into the child process by CreateProcessA. * - the directory definitions (=[A-Z]:=) */ for (ptr2 = env; *ptr2; ptr2 += strlen(ptr2) + 1) { if (strncmp(ptr2, "PATH=", 5) != 0 && + strncmp(ptr2, "CI_COMMIT_AUTHOR=", 17) != 0 && + strncmp(ptr2, "GITLAB_USER_NAME=", 17) != 0 && !is_str_env_drive_dir(ptr2)) { strcpy(ptr, ptr2); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8292
Hi! Thanks for hunting this down. Must have been difficult esp. since it's user dependent. Since a similar failure can happen in future tests as well, I think we should unset them in programs/winetest/main.c instead. What do you think? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8292#note_106325
Hello, thanks for pointing this out, doing this in winetest sounds also like a good place. I have added another merge request !8299 which does it there. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8292#note_106395
Superseeded by !8299. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8292#note_106413
This merge request was closed by Bernhard Übelacker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8292
participants (2)
-
Bernhard Übelacker -
Jinoh Kang (@iamahuman)