-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.21 failed to execute error on Windows 7 #2838
Comments
What is the result of Which device is it? Which Android version? Do yoou use another |
Same problem. Win7 x64, Android 11. |
I added some logs, please replace this binary in v1.21 release then post the output:
diffdiff --git a/app/src/sys/win/process.c b/app/src/sys/win/process.c
index bed98479..3f99dad8 100644
--- a/app/src/sys/win/process.c
+++ b/app/src/sys/win/process.c
@@ -46,6 +46,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
HANDLE stderr_write_handle;
if (pin) {
if (!CreatePipe(&stdin_read_handle, pin, &sa, 0)) {
+ LOGE("Create pipe stdin failed");
perror("pipe");
return SC_PROCESS_ERROR_GENERIC;
}
@@ -56,6 +57,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
}
if (pout) {
if (!CreatePipe(pout, &stdout_write_handle, &sa, 0)) {
+ LOGE("Create pipe stdout failed");
perror("pipe");
goto error_close_stdin;
}
@@ -66,6 +68,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
}
if (perr) {
if (!CreatePipe(perr, &stderr_write_handle, &sa, 0)) {
+ LOGE("Create pipe stderr failed");
perror("pipe");
goto error_close_stdout;
}
@@ -107,6 +110,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
InitializeProcThreadAttributeList(NULL, 1, 0, &size)
|| GetLastError() == ERROR_INSUFFICIENT_BUFFER;
if (!ok) {
+ LOGE("InitializeProcThreadAttributeList failed");
goto error_close_stderr;
}
@@ -118,6 +122,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
ok = InitializeProcThreadAttributeList(lpAttributeList, 1, 0, &size);
if (!ok) {
+ LOGE("InitializeProcThreadAttributeList failed");
free(lpAttributeList);
goto error_close_stderr;
}
@@ -127,6 +132,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
handles, handle_count * sizeof(HANDLE),
NULL, NULL);
if (!ok) {
+ LOGE("UpdateProcThreadAttribute failed");
goto error_free_attribute_list;
}
@@ -154,6 +160,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
dwCreationFlags, NULL, NULL, &si.StartupInfo, &pi);
free(wide);
if (!ok) {
+ LOGE("CreateProcessW failed");
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
ret = SC_PROCESS_ERROR_MISSING_BINARY;
} |
Here you are.
|
Thank you. I forgot to print the error code. Could you do the same with this one, please:
diffdiff --git a/app/src/sys/win/process.c b/app/src/sys/win/process.c
index bed98479..6ed9cb0d 100644
--- a/app/src/sys/win/process.c
+++ b/app/src/sys/win/process.c
@@ -46,6 +46,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
HANDLE stderr_write_handle;
if (pin) {
if (!CreatePipe(&stdin_read_handle, pin, &sa, 0)) {
+ LOGE("Create pipe stdin failed");
perror("pipe");
return SC_PROCESS_ERROR_GENERIC;
}
@@ -56,6 +57,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
}
if (pout) {
if (!CreatePipe(pout, &stdout_write_handle, &sa, 0)) {
+ LOGE("Create pipe stdout failed");
perror("pipe");
goto error_close_stdin;
}
@@ -66,6 +68,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
}
if (perr) {
if (!CreatePipe(perr, &stderr_write_handle, &sa, 0)) {
+ LOGE("Create pipe stderr failed");
perror("pipe");
goto error_close_stdout;
}
@@ -107,6 +110,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
InitializeProcThreadAttributeList(NULL, 1, 0, &size)
|| GetLastError() == ERROR_INSUFFICIENT_BUFFER;
if (!ok) {
+ LOGE("InitializeProcThreadAttributeList failed");
goto error_close_stderr;
}
@@ -118,6 +122,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
ok = InitializeProcThreadAttributeList(lpAttributeList, 1, 0, &size);
if (!ok) {
+ LOGE("InitializeProcThreadAttributeList failed");
free(lpAttributeList);
goto error_close_stderr;
}
@@ -127,6 +132,7 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
handles, handle_count * sizeof(HANDLE),
NULL, NULL);
if (!ok) {
+ LOGE("UpdateProcThreadAttribute failed");
goto error_free_attribute_list;
}
@@ -154,7 +160,9 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
dwCreationFlags, NULL, NULL, &si.StartupInfo, &pi);
free(wide);
if (!ok) {
- if (GetLastError() == ERROR_FILE_NOT_FOUND) {
+ int err = GetLastError();
+ LOGE("CreateProcessW failed: %d", err);
+ if (err == ERROR_FILE_NOT_FOUND) {
ret = SC_PROCESS_ERROR_MISSING_BINARY;
}
goto error_free_attribute_list; |
|
https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699-
🤔 |
This is a Windows 7 specific problem it seems: https://bugzilla.mozilla.org/show_bug.cgi?id=1460995 |
scrcpy 1.21 https://github.com/Genymobile/scrcpy after replaced the scrcpy.exe, output is above messages. |
I'm not code expert, but maybe some of this commits cause bug? |
Could you please test this one?
|
It works, thanks. |
According to this bug report on Firefox: <https://bugzilla.mozilla.org/show_bug.cgi?id=1460995> > CreateProcess fails with ERROR_NO_SYSTEM_RESOURCES on Windows 7. It > looks like the reason why is because PROC_THREAD_ATTRIBUTE_HANDLE_LIST > doesn't like console handles. To avoid the problem, do not pass console handles to PROC_THREAD_ATTRIBUTE_HANDLE_LIST. Refs #2783 <#2783> Refs f801d8b Fixes #2838 <#2838>
I submitted a PR (#2840) and referenced it from the release page. I probably won't publish a new (minor) version just for this (it would increment the version for everyone, whereas only Windows 7 is impacted), I will wait more changes (or at least a few days or more). Windows 7 users could just download the binary from #2840 😉 |
I ran into a similar issue, which would also be solved by this patch.
|
I have the same issue, but on Windows 11 x64. Android 11. When I run as administrator, nothing happens, it just run very quickly and close automatic. But when I just run scrcpy, this message shows: scrcpy 1.21 https://github.com/Genymobile/scrcpy |
for windows 7 32 bits? |
it works. thks! |
@guadeifel Your problem is different:
You set the ADB environment variable to a wrong value: it must point to the |
I just updated #2840 with a link to a 32 bits version. |
Thanks |
Thanks for the answer @rom1v, I made this change. After that, I just turns off and on the permission USB Debugging, and works. 🤘🏻 |
I started getting similar error since 1.21 when running from cygwin on windows 11 (it worked fine until now): $ scrcpy $ adb get-serialno ################# On 1.20 (working) output was: $ scrcpy |
@fusionneur Did you read the issue and the answers of this thread? In short, see #2840. |
Yes, get to the point. I just wanted to share my experience even if it is not related to Win 7, but the error is similar. EDIT: I am running windows 11 |
@fusionneur Oh ok, I didn't understand that it was not on Windows 7. Does #2840 (or |
yes, overwriting scrpcy.exe with the one from #2840 makes it work again under Win 11 via cygwin |
For Windows 10 via cygwin, overwriting scrcpy.exe with the one from #2840 like fusionneur said also fixed this problem for me. It doesn't only happen on Windows 7 or Windows 11. |
Hi, I got a similar issue, after overwriting with #2840 scrcpy.exe, I got the following result. C:\Tools\scrcpy-win64-v1.21>scrcpy.exe C:\Tools\scrcpy-win64-v1.21>adb get-serialno |
@rom1v Thank you very much. But if I set my system environment parameter for ADB to C:\Android\SDK\platform-tools\adb.exe, the global ADB will not work any more. Seems scrcpy will use the one within its same folder. |
No, it will use the one you provide in ADB. |
Hi, I got a similar issue, after overwriting with #2840 scrcpy.exe, I got the following result. scrcpy 1.21 https://github.com/Genymobile/scrcpy OS: Windows 7 32 bits Edit: solved. |
how you solved it? |
i am getting disconnections when locking/unlocking phone with the replaced exe |
@Gabriel4927 https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#exception
@fusionneur #597 |
Decreasing quality, the program doesn't accept the full quality of the screen |
Can anyone help me with this? scrcpy 1.23 https://github.com/Genymobile/scrcpy |
You set the ADB environment to a wrong value (it must point to the adb.exe executable, not its parent directory). But you should remove this environment variable unless you absolutely need to use a custom adb. |
It was running perfectly until one day I get this issue: D:>scrcpy |
Can you execute |
Environment
Describe the bug
run scrcpy-console.bat without any params, it seems no serial was gotten. at the same time, 1.20 is working fine.
any suggestion is appreciated, thx.
The text was updated successfully, but these errors were encountered: