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

Crash : java.lang.NullPointerException at BackendService.backgroundProcessing #24

Open
Massedil opened this issue Apr 11, 2024 · 7 comments

Comments

@Massedil
Copy link

Version : 1.2.11 F-Droid
Android 14 / LineageOS 21 on Samsung A52s

FATAL EXCEPTION: DefaultDispatcher-worker-1
Process: helium314.localbackend, PID: 29126
java.lang.NullPointerException
at org.fitchfamily.android.dejavu.BackendService.backgroundProcessing(BackendService.kt:754)
at org.fitchfamily.android.dejavu.BackendService.access$backgroundProcessing(BackendService.kt:50)
at org.fitchfamily.android.dejavu.BackendService$queueForProcessing$1.invokeSuspend(BackendService.kt:724)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2a57992, Dispatchers.IO]
@Helium314
Copy link
Owner

when does it happen?

@Massedil
Copy link
Author

Good question. Don't really know.

Here, location freshly activated for a Bluetooth Low Energy usage. I have launched a Bluetooth scan in this app.

I think it is here it crashes.

@Massedil
Copy link
Author

I also think I crashes if I'm on Airplane mode and use location in OSMAnd app, for example. But not sure it is always crashing doing this.

@Helium314
Copy link
Owner

Interesting... the line in question is https://github.com/Helium314/Local-NLP-Backend/blob/main/app/src/main/java/org/fitchfamily/android/dejavu/BackendService.kt#L754
Looks like emitterCache is null, but it's actually used just a few lines above, where it's definitely not null (the crash would happen already there if it was).

@Massedil
Copy link
Author

Looks like emitterCache is null,

Or observation.identification ?

@Helium314
Copy link
Owner

Observations are in observations: Collection<Observation>, which as far as I understand Kotlin cannot contain null elements. If the observation was null, then the crash should happen when adding to the collection.
observation.identification also is not nullable.

EmitterCache is the only thing that can be null, but should only be null if the service is being closed while backgroundProcessing is running.
This is why I was asking when the crash happens. If it's when closing, then it simply shouldn't matter.

@Massedil
Copy link
Author

This is why I was asking when the crash happens. If it's when closing, then it simply shouldn't matter.

I was not using the app. The app should have been started in background when I activated the location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants