Skip to content
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

[Bug] Gnirehtet failed to run, Unexpected 'somp_thr', was expecting 'package:' #328

Open
Unknown78 opened this issue Dec 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Unknown78
Copy link

Unknown78 commented Dec 7, 2024

Backgrounds

OS: Windows 11
Release package: Escrcpy-1.27.6-win-x64.zip

It was fine with the previous release of Escrcpy-1.27.5-win-x64.zip


Steps to reproduce

  1. Connect the phone with USB
  2. Run Escrcpy.exe
  3. Click Gnirehtet

An error in yellow font color with exclamation mark shows up:

Unexpected 'somp_thr', was expecting 'package:'

I did try to reset the preferences, but it doesn't work.
I did try to enable the Gnirehtet Fix option, but it doesn't work.

An interesting thing is that, after I click the button, the debug log shows one line of error:

[2024-12-07 17:52:29.640] [error] relay.gnirehtet.process.stderr.data: 2024-12-07 17:52:29.638 ERROR Main: Execution error: IO error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)
@Unknown78 Unknown78 added the bug Something isn't working label Dec 7, 2024
@Unknown78
Copy link
Author

@viarotel still not fixed with Escrcpy-1.28.3-win-x64.zip

@viarotel
Copy link
Collaborator

viarotel commented Jan 7, 2025

I analyzed your error because the port 31416 required by Gnirehtet is occupied, and I tested my phone in v1.28.3 and it works fine.

@Unknown78
Copy link
Author

Unknown78 commented Jan 7, 2025

That doesn't make sense, then why the previous version of v1.27.5 is working fine?
Where does the keyword of somp_thr came from? I couldn't find it anywhere.

@viarotel
Copy link
Collaborator

viarotel commented Jan 8, 2025

I won't close this question for now, you're the only one reporting this problem, but I do need more details like how to quickly reproduce the issue, since it works fine on my device.

@Unknown78
Copy link
Author

Unknown78 commented Jan 8, 2025

To isolate the issue, I have tested to manually run gnirehtet run with the platform-tools (adb), from both of the version and it was success.
So the gnirehtet and adb itself has no problem.
Somehow Escrcpy failed to execute the wrapped command in the newer version.


After the somp_thr error, there was a leftover of gnirehtet.exe process not being killed.
With process explorer I could see that it has the command line of relay
So the command gnirehtet.exe relay is successfully executed by Escrcpy.
The error of somp_thr cames after that.


It turns out the port occupied error is caused if I click the Gnirehtet more than once.
If gnirehtet.exe relay is previously not running, then there will be no port occupied error.


The difference from v1.27.5 from v1.27.6 on the file of electron/exposes/gnirehtet/index.js is the commit of 0e098c3.
Not sure what causes it.


P.S. The phone OS is Nougat 7.1 API 25 if that matters.

The relevant logcat with the newer version:

01-08 23:56:47.947  1733  1733 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
01-08 23:56:47.955  1733  1733 I art     : System.exit called, status: 0
01-08 23:56:47.955  1733  1733 I AndroidRuntime: VM exiting with result code 0.

(desktop gui somp_thr error)

The relevant logcat with the previous version:

01-09 00:06:28.380  2346  2346 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
01-09 00:06:28.386  2346  2346 I art     : System.exit called, status: 0
01-09 00:06:28.386  2346  2346 I AndroidRuntime: VM exiting with result code 0.

01-09 00:06:28.905  2351  2351 D AndroidRuntime: Calling main entry com.android.commands.am.Am
01-09 00:06:28.919  5206  5699 I ActivityManager: START u0 {act=com.genymobile.gnirehtet.START typ=null flg=0x10000000 cmp=ComponentInfo{com.genymobile.gnirehtet/com.genymobile.gnirehtet.GnirehtetActivity}} from uid 2000 on display 0

(and so on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants