Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

random crashes
Started by Aarbron Mar 21 2019 11:46 PM

44 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Hello.

 

I have noticed a random crash affecting a few hundred users.

 

I can't reproduce it but got some help from players and managed to find the reason.

The parameter create = true in gpgs.snapshots.open() causes random crashes.

gpgs.snapshots.open({
    filename = "savedata",
    create = true,
    listener = gpgsSnapshotOpenForSaveListener
})

If I comment out the line, everything works fine.

 

I'm using gpgs version 2 and the only difference I can see (compared to version 1) is that there is a change in conflictPolicy parameter's default value. In version 1 was "last known good" and in version 2 is "manual".

 

I have never used that parameter. Would it help if I was changing it to "last known good"?



[TOPIC: post.html]
#2

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Do they have a traceback or something?



[TOPIC: post.html]
#3

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Hi vlads.

Thank you for the reply.

at java.util.Hashtable.put (Hashtable.java:461)
at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282)
at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312)
at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503)
at com.google.android.gms.tasks.zzj.run (Unknown Source:23)
at android.os.Handler.handleCallback (Handler.java:794)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:173)
at android.app.ActivityThread.main (ActivityThread.java:6634)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:822)

edit:

To be clear. Everything works fine with gpgs version 1.

It has to do with gpgs version 2 only.

That's why I wrote about the change in conflictPolicy.


Edited by Aarbron, 22 March 2019 - 09:23 AM.


[TOPIC: post.html]
#4

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

More users contacted with us about this crash and did some more tests.

 

On some devices the crash stops if comment out the parameter create = true in gpgs.snapshots.open().

On some others it doesn't help and the crash keeps happening.

 

I understand you got a lot to do but not giving priority to things like this is a mistake.



[TOPIC: post.html]
#5

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Hey! Sorry for not responding earlier
Here's code which is crashing:
yCOt0OP.png

 

Game description is returning Null and it crashes serialization. It seems like easiest solution would be to make sure to always have some description field when saving (it could be an empty string, but not nil)



[TOPIC: post.html]
#6

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

So it's not about gpgs.snapshots.open but gpgs.snapshots.save?

Something like this?

gpgs.snapshots.save({
  snapshotId = event.snapshotId,
  description = "saved",
  listener = gpgsSnapshotAfterSaveListener
})


[TOPIC: post.html]
#7

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Yes, it seems so. But code should be consistent. It seems once snapshot is saved w/o game description it should always fail on open. Try reproducing it first?



[TOPIC: post.html]
#8

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

I can't reproduce it in my devices.



[TOPIC: post.html]
#9

mysticeti

[GLOBAL: userInfoPane.html]
mysticeti
  • Contributor

  • 122 posts
  • Corona SDK

I am using build 2019.3470 and gpgs v2 plugin.

 

I am also getting the following error trace from google play. 

Device: Samsung galaxy Note 8 and Android 8.0

 

But in my device I don't get the error and I am seeing the error in a subset of players only.

 

java.lang.NullPointerException:
 
at java.util.Hashtable.put (Hashtable.java:461)
 
at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282)
 
at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312)
 
at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503)
 
at com.google.android.gms.tasks.zzj.run (Unknown Source:23)
 
at android.os.Handler.handleCallback (Handler.java:789)
 
at android.os.Handler.dispatchMessage (Handler.java:98)
 
at android.os.Looper.loop (Looper.java:164)
 
at android.app.ActivityThread.main (ActivityThread.java:6940)
 
at java.lang.reflect.Method.invoke (Native Method)
 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
 
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)


[TOPIC: post.html]
#10

mysticeti

[GLOBAL: userInfoPane.html]
mysticeti
  • Contributor

  • 122 posts
  • Corona SDK

@vlads

 

I just checked. I had game description " game score" from before already and still seeing the crashes. 

 

Another crash trace I am seeing is the following: 

 

java.lang.NullPointerException:
 
at java.util.Hashtable.put (Hashtable.java:442)
 
at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282)
 
at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312)
 
at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503)
 
at com.google.android.gms.tasks.zzj.run (Unknown Source)
 
at android.os.Handler.handleCallback (Handler.java:751)
 
at android.os.Handler.dispatchMessage (Handler.java:95)
 
at android.os.Looper.loop (Looper.java:154)
 
at android.app.ActivityThread.main (ActivityThread.java:6682)
 
at java.lang.reflect.Method.invoke (Native Method)
 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
 
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)


[TOPIC: post.html]
#11

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

@vlads please check it again.

 

Crashes keep coming for the same reason although I did what you wrote.



[TOPIC: post.html]
#12

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Nothing?

 

Version 1 gives a lot of ANRs and version 2 a lot of crashes. 

Corona doesn't have a working gpgs plugin right now.

 

It's a big issue and nobody seems to care.



[TOPIC: post.html]
#13

mysticeti

[GLOBAL: userInfoPane.html]
mysticeti
  • Contributor

  • 122 posts
  • Corona SDK

@Aarbron,

let's wait awhile for Corona team to find a fix so that they can update us. :)



[TOPIC: post.html]
#14

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

@mysticeti

It's not that simple when you get 1 star reviews and emails about an error that you can't fix.

 

Corona should at least inform us about this issue. 

They don't respond here or in emails.

 

I'm part of this community for almost 7 years and that kind of behaviour is really worrying.



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

I'll re-ping our engineers.



[TOPIC: post.html]
#16

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Thank you Rob.

 

vlads wrote about missing (optional ) parameter description = "".

I added it and the problem remains with users coming back after long breaks and even with new users!

Totally random.

Last crash was from s9 device although I have thousands users with that device without any problem!

 

Also you should keep the compatibility with gpgs version 1.

I didn't have this (optional) parameter and everything worked fine!

That's what should happen with version 2.

If you don't change I will keep having random crashes with players coming back after long breaks.

 

Another user reported same issues in this topic and he uses the description parameter from the beginning. 

That complicates everything even more.

 

Please let me know when you have any news.

 

Thank you!



[TOPIC: post.html]
#17

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Makes sense. I added a lot of null checks. Now null values should just be ignored. Please, make a new build and see if you can reproduce a bug again.



[TOPIC: post.html]
#18

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

First test.

Build with corona 2019.3473.

 

 

Retrieving saved data from snapshots doesn't work any more.

 

vlads whatever you did broke the plugin even more!

gpgs.snapshots.open fails completely. Doesn't even get to the listener parameter.

 

On the other hand log in reminds more the gpgs ver 1 and I like it.

Every time you install or delete app's data the welcome message and choose account message both appear.

In gpgs version 2 it happens only the first ever time you install an application.  



[TOPIC: post.html]
#19

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Any details? Is there any output when you fail to load a game? "everything is broken" doesn't really help.



[TOPIC: post.html]
#20

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

I'm off work right now.

Later I will get some logs.

 

I made the post because it's really serious.

gpgs.snapshots.open listener paramerter doesn't work and you can't get your saved snapshots.

local function gpgsSnapshotOpenForReadListener( event )
	print( "snapshot open event:", json.prettify(event) )
	if not event.isError then
		local data = event.snapshot.contents.read()
		native.showAlert('Snapshots', 'Reading was ' .. (event.isError and 'unsuccessful' or 'successful') .. ',', { 'OK'})
	end
end

function myData.openSnapshot()
	print("Opening snapshot")
	myData.gpgs.snapshots.open({
		filename = snapshotFilename,
                create = true,
		listener = gpgsSnapshotOpenForReadListener
	})
end

gpgsSnapshotOpenForReadListener doesn't get called.

 

 

Imho you should check it soon.



[TOPIC: post.html]
#21

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

2019.3474 has issue with gpgs version 2.

 

Just build with 2019.3468 and it works ok.



[TOPIC: post.html]
#22

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

I reverted changes in my latest null check commit. It would take some work to get a proper fix for crashes. I'm working on it.


  • mysticeti likes this

[TOPIC: post.html]
#23

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Thank you vlads.

I hope it won't take too long.

 

Please let me know when it's done and I will test it asap.



[TOPIC: post.html]
#24

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Don't know if it's gonna help but today I got a user review saying that crashes, (playing the live app downloaded from play store) have stopped. I haven't changed anything and the app was updated on Saturday. 

 

Also, the past days, working with a user who has that problem (I can't reproduce the crash in my devices) eventually had crashes although we created new filenames for the snapshots (using all the parameters this time).



[TOPIC: post.html]
#25

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 722 posts
  • Corona Staff

Hello! I deployed new version of the plugin. It should ignore null fields and snapshots should still work. Please, give it a try.




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]