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

Make sure Scheduler::GetCurrent() cannot return a nullptr #2887

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

louwers
Copy link
Collaborator

@louwers louwers commented Oct 1, 2024

I think when the call to JNI_OnLoad and thus registerNatives on the main thread gets delayed, it is possible that Scheduler::GetCurrent() returns a nullptr, which crashes the program. This change prevents a nullptr from being returned, falling back to a thread-local Scheduler.

Another attempt to fix #2779

@louwers louwers added bug Something isn't working android labels Oct 1, 2024
@louwers louwers requested a review from mwilsnd October 1, 2024 13:30
Copy link

github-actions bot commented Oct 1, 2024

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +568  +0.0%    +368    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2887-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +28% +32.6Mi  +426% +25.4Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2887-compared-to-legacy.txt

@louwers louwers requested a review from mwilsnd October 1, 2024 15:10
Copy link

github-actions bot commented Oct 1, 2024

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            +0.0026         +0.0019             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-2887-compared-to-main.txt

Copy link

github-actions bot commented Oct 1, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +424  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2887-compared-to-main.txt

@louwers
Copy link
Collaborator Author

louwers commented Oct 1, 2024

@tdcosta100 Do you know why we get linker errors on Windows?

@louwers louwers merged commit 4d7d5f5 into maplibre:main Oct 4, 2024
38 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on startup AndroidRendererFrontend
3 participants