microg / microg/GmsCore

Crash while fetching network location from WIFIonICE moving wifi network

Open
#2,704 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Describe the bug

When on an ICE train in Germany and connected to the "WIFIonICE" network, I never get a network location from microG that is identical to the train's GPS location (as reported by the API).

To Reproduce

Steps to reproduce the behavior:

  1. Get on an ICE train (or stand next to one in a station?), connect to its WIFIonICE network and log into the network
  2. Start a logcat app, e.g. "Logcat Reader", and start recording messages
  3. Open any app that requests a location (e.g. a maps app)
  4. See error in logcat: "Failed retrieving location for current moving wifi WIFIonICE: java.net.SocketException: Binding socket to network 101 failed: EPERM (Operation not permitted)" (see traceback below)

Expected behavior

I expect the maps app to show my location identical with the train's location almost immediately, with an appropriate accuracy (judging by microG code, that would be 100m).

Screenshots

N/A

System

  • Android Version: 14 (AP2A.240905.003)
  • Custom ROM: LineageOS 21-20241211-microG-FP4 (from lineage.microg.org)
  • microG Services app: 0.3.6.244735 (244735012), from microG F-Droid repo

Additional context

Failed retrieving location for current moving wifi WIFIonICE
java.net.SocketException: Binding socket to network 101 failed: EPERM (Operation not permitted)
	at android.net.Network.bindSocket(Network.java:442)
	at android.net.Network.bindSocket(Network.java:409)
	at android.net.Network$NetworkBoundSocketFactory.createSocket(Network.java:269)
	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:114)
	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
	at org.microg.gms.location.network.wifi.MovingWifiHelper$retrieveMovingLocation$2.invokeSuspend(MovingWifiHelper.kt:140)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: android.system.ErrnoException: Binding socket to network 101 failed: EPERM (Operation not permitted)
	at android.net.Network.bindSocket(Network.java:441)
	... 22 more

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at org.microg.gms.location.network.wifi.MovingWifiHelper.kt:140 and reproduce the failure on Android 14 while connected to WIFIonICE, using logcat to confirm the socket-binding exception. Trace how the moving Wi-Fi location request handles this network, and consider the issue resolved when the request no longer crashes or fails for this network and the expected location behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, kotlin
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.