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

iOS 12 Beta freezes and memory leaks #317

Closed
obigu opened this Issue Jul 19, 2018 · 18 comments

Comments

Projects
None yet
7 participants
@obigu

obigu commented Jul 19, 2018

Issue details

Creating the issue to have it tracked and show progress.

Several people have reported their games suffer from random freezes when using iOS 12 (reproduced on all betas from Dev Beta 1 to Dev Beta 4).

Maybe related to that, memory leaks occur when running on iOS 12, most of them associated to 3rd party sdks such as ads SDKs when initializing or downloading ads and triggered by WebKit, Core Telephony frameworks.

Some more info on libGDX forum thread
https://www.badlogicgames.com/forum/viewtopic.php?f=11&t=27973
And on the Ingress subReddit (Ingress uses RoboVM), apparently on the Beta dev 4 the game is not able to establish SSL connection:
https://www.reddit.com/r/Ingress/comments/8vv9ea/does_ios_12_beta_3_fix_the_crash_and_freezing/?st=jjsgwpv4&sh=79f2fed0

Reproduction steps/code

Unfortunately unable to provide reliable reproduction steps or simple SSCCE so far

@dkimitsa

This comment has been minimized.

Show comment
Hide comment
@dkimitsa

dkimitsa Jul 20, 2018

Contributor

as I saw at apple forums this happens even with native apps which means robovm is not root case here but beta itself.

Contributor

dkimitsa commented Jul 20, 2018

as I saw at apple forums this happens even with native apps which means robovm is not root case here but beta itself.

@obigu

This comment has been minimized.

Show comment
Hide comment
@obigu

obigu Jul 20, 2018

I hope you're right @dkimitsa. We need to be vigilant though, I've been following on forums and testing apps and games myself and even if many users complained on Beta 1, Beta 4 seems to be quite stable and few games have issues anymore (at least reported issues).
Official release will be in less than 2 months with several beta releases before that. If on the next betas problems persist I believe we should start seriously considering the issue is probably on RoboVM side.

obigu commented Jul 20, 2018

I hope you're right @dkimitsa. We need to be vigilant though, I've been following on forums and testing apps and games myself and even if many users complained on Beta 1, Beta 4 seems to be quite stable and few games have issues anymore (at least reported issues).
Official release will be in less than 2 months with several beta releases before that. If on the next betas problems persist I believe we should start seriously considering the issue is probably on RoboVM side.

@ericnondahl

This comment has been minimized.

Show comment
Hide comment
@ericnondahl

ericnondahl Jul 25, 2018

Contributor

After a bunch of experimentation, I created a sample app that recreates the issue. It's a basic libGDX sample app with desktop and iOS platforms that repeatedly opens and closes a native dialog, along with some GC use every 100ms.

It becomes non-responsive on iOS 12 beta 4 pretty consistently within 5 minutes.

https://github.com/ericnondahl/libgdx-ios12-sample

Contributor

ericnondahl commented Jul 25, 2018

After a bunch of experimentation, I created a sample app that recreates the issue. It's a basic libGDX sample app with desktop and iOS platforms that repeatedly opens and closes a native dialog, along with some GC use every 100ms.

It becomes non-responsive on iOS 12 beta 4 pretty consistently within 5 minutes.

https://github.com/ericnondahl/libgdx-ios12-sample

@Tom-Ski

This comment has been minimized.

Show comment
Hide comment
@Tom-Ski

Tom-Ski Jul 25, 2018

Member

Great!

Member

Tom-Ski commented Jul 25, 2018

Great!

@dkimitsa

This comment has been minimized.

Show comment
Hide comment
@dkimitsa

dkimitsa Aug 2, 2018

Contributor

traced it down to simple System.gc(), simplified code to reproduce in the post bellow:
https://dkimitsa.github.io/2018/08/02/investigating-ios12-beta-crashes/

update: POC project
https://github.com/dkimitsa/codesnippets/tree/master/ios12bc-case

Contributor

dkimitsa commented Aug 2, 2018

traced it down to simple System.gc(), simplified code to reproduce in the post bellow:
https://dkimitsa.github.io/2018/08/02/investigating-ios12-beta-crashes/

update: POC project
https://github.com/dkimitsa/codesnippets/tree/master/ios12bc-case

@dkimitsa

This comment has been minimized.

Show comment
Hide comment
@dkimitsa
Contributor

dkimitsa commented Aug 8, 2018

@keesvandieren

This comment has been minimized.

Show comment
Hide comment
@keesvandieren

keesvandieren Aug 11, 2018

Contributor

On 6 August beta 6 has been released. Does issue still exist there?

Source: https://www.macrumors.com/2018/08/06/apple-seeds-ios-12-beta-6-to-developers/

As issue is reproduced in native code, is it an iOS platform issue? Or is the native code buggy?

Contributor

keesvandieren commented Aug 11, 2018

On 6 August beta 6 has been released. Does issue still exist there?

Source: https://www.macrumors.com/2018/08/06/apple-seeds-ios-12-beta-6-to-developers/

As issue is reproduced in native code, is it an iOS platform issue? Or is the native code buggy?

@obigu

This comment has been minimized.

Show comment
Hide comment
@obigu

obigu Aug 11, 2018

Yes, the issue is still present on Beta 6.

@dkimitsa Explains the issue very clearly here https://dkimitsa.github.io/2018/08/08/investigating-ios12-beta-crash-vol2/. Even if it it looks it's an Apple issue, it's not manifesting on most game engines so the pressure on Apple to investigate it/fix it in time is low. We need a plan B and hopefully @dkimitsa will do some magic.

obigu commented Aug 11, 2018

Yes, the issue is still present on Beta 6.

@dkimitsa Explains the issue very clearly here https://dkimitsa.github.io/2018/08/08/investigating-ios12-beta-crash-vol2/. Even if it it looks it's an Apple issue, it's not manifesting on most game engines so the pressure on Apple to investigate it/fix it in time is low. We need a plan B and hopefully @dkimitsa will do some magic.

@keesvandieren

This comment has been minimized.

Show comment
Hide comment
@keesvandieren

keesvandieren Aug 11, 2018

Contributor

Thanks for the update

Contributor

keesvandieren commented Aug 11, 2018

Thanks for the update

@ericnondahl

This comment has been minimized.

Show comment
Hide comment
@ericnondahl

ericnondahl Aug 13, 2018

Contributor

The updated GC which only stops/resumes threads it knows about successfully resolves the issue in the POC libGDX sample app referenced above on iOS 12 beta 6, iPhone X.

Could the thread safety issue be worked around by making sure that callbacks from native code are placed on the native thread with something like Gdx.app.postRunnable()? This is a typical approach for callbacks anyway. I haven't tested the updated GC on a non-trivial app so I don't know the ramifications there.

Contributor

ericnondahl commented Aug 13, 2018

The updated GC which only stops/resumes threads it knows about successfully resolves the issue in the POC libGDX sample app referenced above on iOS 12 beta 6, iPhone X.

Could the thread safety issue be worked around by making sure that callbacks from native code are placed on the native thread with something like Gdx.app.postRunnable()? This is a typical approach for callbacks anyway. I haven't tested the updated GC on a non-trivial app so I don't know the ramifications there.

@ericnondahl

This comment has been minimized.

Show comment
Hide comment
@ericnondahl

ericnondahl Aug 13, 2018

Contributor

Issue still present on Beta 7

Contributor

ericnondahl commented Aug 13, 2018

Issue still present on Beta 7

@florianf

This comment has been minimized.

Show comment
Hide comment
@florianf

florianf Aug 21, 2018

Collaborator

Should be fixed when built from latest master. @Tom-Ski pretty please for a new Snapshot build.

Collaborator

florianf commented Aug 21, 2018

Should be fixed when built from latest master. @Tom-Ski pretty please for a new Snapshot build.

@ericnondahl

This comment has been minimized.

Show comment
Hide comment
@ericnondahl

ericnondahl Aug 22, 2018

Contributor

Looks like this change did not make it into last night's snapshot, dist... vm/ios/arm64/libgc.a is exactly the same as it was in the 2.3.4-SNAPSHOT from February, (compared via unix diff.)

Contributor

ericnondahl commented Aug 22, 2018

Looks like this change did not make it into last night's snapshot, dist... vm/ios/arm64/libgc.a is exactly the same as it was in the 2.3.4-SNAPSHOT from February, (compared via unix diff.)

@DavidBVal

This comment has been minimized.

Show comment
Hide comment
@DavidBVal

DavidBVal Aug 23, 2018

EDIT: seems like it was a plugin update issue in my machine, please disregard my report below.

Snapshot was rebuilt today but I am still getting random freezes followed by crashes, 5-15 minutes after opening the game. It seems the crash is less frequent if I leave my iPad on a stand and charging, but they can still happen. Here is a sample crash:

`Date/Time: 2018-08-23 16:06:00.0302 +0200
Launch Time: 2018-08-23 16:00:59.1958 +0200
OS Version: iPhone OS 12.0 (16A5362a)
Baseband Version: n/a
Report Version: 104

Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-update watchdog transgression: net.fdgames.ek.ios exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 255.220 (user 255.220, system 0.000), 42% CPU", | "Elapsed application CPU time (seconds): 117.743, 20% CPU" | )
Triggered by Thread: 0`

Full log: https://pastebin.com/SUGuAcLh

DavidBVal commented Aug 23, 2018

EDIT: seems like it was a plugin update issue in my machine, please disregard my report below.

Snapshot was rebuilt today but I am still getting random freezes followed by crashes, 5-15 minutes after opening the game. It seems the crash is less frequent if I leave my iPad on a stand and charging, but they can still happen. Here is a sample crash:

`Date/Time: 2018-08-23 16:06:00.0302 +0200
Launch Time: 2018-08-23 16:00:59.1958 +0200
OS Version: iPhone OS 12.0 (16A5362a)
Baseband Version: n/a
Report Version: 104

Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-update watchdog transgression: net.fdgames.ek.ios exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 255.220 (user 255.220, system 0.000), 42% CPU", | "Elapsed application CPU time (seconds): 117.743, 20% CPU" | )
Triggered by Thread: 0`

Full log: https://pastebin.com/SUGuAcLh

@DavidBVal

This comment has been minimized.

Show comment
Hide comment
@DavidBVal

DavidBVal Aug 24, 2018

Seems like it was all caused by a plugin update issue in Eclipse, issue seems to be resolved although I am still performing exhaustive tests. Thanks to @dkimitsa for the analysis and solution and to everyone else involved in the update.

DavidBVal commented Aug 24, 2018

Seems like it was all caused by a plugin update issue in Eclipse, issue seems to be resolved although I am still performing exhaustive tests. Thanks to @dkimitsa for the analysis and solution and to everyone else involved in the update.

@obigu

This comment has been minimized.

Show comment
Hide comment
@obigu

obigu Aug 24, 2018

I'm closing it since the fix works (if new iOS12 issues appear best to have a separate issue). Thanks everybody for your effort, specially @dkimitsa

obigu commented Aug 24, 2018

I'm closing it since the fix works (if new iOS12 issues appear best to have a separate issue). Thanks everybody for your effort, specially @dkimitsa

@obigu obigu closed this Aug 24, 2018

@keesvandieren

This comment has been minimized.

Show comment
Hide comment
@keesvandieren

keesvandieren Aug 25, 2018

Contributor

On chat, there was a question open: has it also been resolved for 32 bits apps? Is there anything that has to be done for that?

Contributor

keesvandieren commented Aug 25, 2018

On chat, there was a question open: has it also been resolved for 32 bits apps? Is there anything that has to be done for that?

@keesvandieren

This comment has been minimized.

Show comment
Hide comment
@keesvandieren

keesvandieren Aug 25, 2018

Contributor

It was clarified on chat, that the patch is complete now:
image

Contributor

keesvandieren commented Aug 25, 2018

It was clarified on chat, that the patch is complete now:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment