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 with multiple live locations shared in one chat #275

Closed
Self-Perfection opened this issue Nov 9, 2018 · 6 comments
Closed

Crash with multiple live locations shared in one chat #275

Self-Perfection opened this issue Nov 9, 2018 · 6 comments
Labels

Comments

@Self-Perfection
Copy link

Normal scenario: a person shares his live location in a chat. Dynamic map image with marker appears in this chat. Tapping on this image shows slippy map with person position.

Steps to reproduce:

  • A person and his interlocutor share their live location simultaneously
  • Two separate map images are visible in chat
  • Tap on either of this map images. App crashes (instead of showing slippy map with two markers)

Here is what appears in log:

...
W/View    ( 9958): requestLayout() improperly called by org.telegram.ui.Components.RecyclerListView{a6aab6a0 VFED.... ......ID 0,0-720,1183} during layout: running second layout pass
W/View    ( 9958): requestLayout() improperly called by android.widget.FrameLayout{a6aa8288 V.E..... ......ID 0,0-720,1183} during layout: running second layout pass
D/AndroidRuntime( 9958): Shutting down VM
W/dalvikvm( 9958): threadid=1: thread exiting with uncaught exception (group=0xa589fba8)
E/AndroidRuntime( 9958): FATAL EXCEPTION: main
E/AndroidRuntime( 9958): Process: org.telegram.messenger, PID: 9958
E/AndroidRuntime( 9958): java.lang.IllegalArgumentException: north must be in [-85.05112877980659,85.05112877980659]
E/AndroidRuntime( 9958): 	at org.osmdroid.util.BoundingBox.set(BoundingBox.java:67)
E/AndroidRuntime( 9958): 	at org.osmdroid.views.Projection.refresh(Projection.java:649)
E/AndroidRuntime( 9958): 	at org.osmdroid.views.Projection.<init>(Projection.java:99)
E/AndroidRuntime( 9958): 	at org.osmdroid.views.Projection.<init>(Projection.java:65)
E/AndroidRuntime( 9958): 	at org.osmdroid.views.MapView.getProjection(MapView.java:347)
E/AndroidRuntime( 9958): 	at org.osmdroid.views.MapView.dispatchDraw(MapView.java:1162)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14492)
E/AndroidRuntime( 9958): 	at android.widget.FrameLayout.draw(FrameLayout.java:472)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13386)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14492)
E/AndroidRuntime( 9958): 	at android.widget.FrameLayout.draw(FrameLayout.java:472)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13386)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at org.telegram.ui.ActionBar.ActionBarLayout$LinearLayoutContainer.drawChild(ActionBarLayout.java:89)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at org.telegram.ui.ActionBar.ActionBarLayout.drawChild(ActionBarLayout.java:342)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at org.telegram.ui.ActionBar.DrawerLayoutContainer.drawChild(DrawerLayoutContainer.java:492)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13381)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14206)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
E/AndroidRuntime( 9958): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
E/AndroidRuntime( 9958): 	at android.view.View.draw(View.java:14492)
E/AndroidRuntime( 9958): 	at android.widget.FrameLayout.draw(FrameLayout.java:472)
E/AndroidRuntime( 9958): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2326)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13386)
E/AndroidRuntime( 9958): 	at android.view.View.getDisplayList(View.java:13428)
E/AndroidRuntime( 9958): 	at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1570)
E/AndroidRuntime( 9958): 	at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1449)
E/AndroidRuntime( 9958): 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2377)
E/AndroidRuntime( 9958): 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2249)
E/AndroidRuntime( 9958): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1879)
E/AndroidRuntime( 9958): 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:996)
E/AndroidRuntime( 9958): 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5600)
E/AndroidRuntime( 9958): 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
E/AndroidRuntime( 9958): 	at 
W/ActivityManager( 5459):   Force finishing activity org.telegram.messenger/org.telegram.ui.LaunchActivity
I/Process ( 9958): Sending signal. PID: 9958 SIG: 9
I/ActivityManager( 5459): Process org.telegram.messenger (pid 9958) has died.
I/WindowState( 5459): WIN DEATH: Window{a65c78d0 u0 org.telegram.messenger/org.telegram.ui.LaunchActivity}
W/ActivityManager( 5459): Scheduling restart of crashed service org.telegram.messenger/.LocationSharingService in 1000ms
I/AlienService( 5459): notifySurfaceDied() surfaceId = 12
I/AlienServiceJNI( 5459): notifySurfaceDied() surfaceId = 12
D/WLAlienRuntime( 5459): notifySurfaceDied() surfaceId = 12, mAlienState = 1
W/ActivityManager( 5459): Service crashed 2 times, stopping: ServiceRecord{a6616340 u0 org.telegram.messenger/.NotificationsService}
D/ActivityManager( 5459): handleAppDiedLocked app = ProcessRecord{a6328bb8 0:org.telegram.messenger/u0a29}
D/ActivityManager( 5459): getSurfaceToDestroyLocked, surfaceToDestroy = 12
D/ActivityManager( 5459): The app on surface (surfaceId = 12) has died!
D/ActivityManager( 5459): handleAppDiedLocked app = ProcessRecord{a6328bb8 0:org.telegram.messenger/u0a29}
D/ActivityManager( 5459): getSurfaceToDestroyLocked, surfaceToDestroy = -1
D/NotificationService( 5459): onNativeNotificationRemoved id=41539
...

Version: 4.9.1 from F-Droid

@Bubu
Copy link
Collaborator

Bubu commented Nov 10, 2018

Thanks for the report, can confirm!

I'll take a loot at this.

Just to make sure, this works with upstream telegram?

@Bubu Bubu added the bug label Nov 10, 2018
@Self-Perfection
Copy link
Author

This works with upstream. Telegram build from Google Play show slippy map with several markers, one for each shared live location.

@Bubu
Copy link
Collaborator

Bubu commented Nov 26, 2018

Spent some time investigating this but I'm running out of time for now.

The same exception is triggered here shortly before the crash: a290358#diff-4fb1655a7139efd0cd436d09c774ebf1R1175

But there it doesn't cause a crash due to the try/catch. When debugging the BoundingBox.set method I only ever noticed NaN as an outlier value. But trying to catch that at LocationActivity#1158 didn't work though.

I might open an issue with osmdroid tomorrow if they can help pinpoint what's going wrong here.

@monsieurtanuki
Copy link

Could be provoked by the fact that you need to use a post syntax in order to set the center and the zoom of a MapView at init time.

The reason: at the very beginning, the MapView as a View has no width and height (getWidth() returns 0), and we (at osmdroid) use the width and the height in order to compute the offsets.

I guess you should use something like:

mMapView.post(new Runnable() {
    @Override
    public void run() {
        mMapView.setExpectedCenter(new GeoPoint(48.85825,2.29448));
        controller.setZoom(7.);
    }
});

I hope this helps.

@Bubu
Copy link
Collaborator

Bubu commented Nov 27, 2018

@monsieurtanuki Thank you! I'll have to look into this, if this helps.

@thermatk thermatk closed this as completed Feb 9, 2019
thermatk added a commit that referenced this issue Feb 9, 2019
thermatk added a commit that referenced this issue Mar 9, 2019
andrew-ld pushed a commit to andrew-ld/PWRTelegram that referenced this issue May 14, 2019
@theonlytruth
Copy link

theonlytruth commented Feb 18, 2023

I have a similar problem with the version 9.3.3 of the FOSS Telegram with an old Android phone and also with a new one. It crashes when opening the map screen when more than one person is sharing it's location.

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

No branches or pull requests

4 participants