Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-873

[Bug]: Unity Editor Crashing (Difficult to Repro)

      What happened?

      We've been seeing hard crashes of the Unity Editor that fail to produce crash reports. We have flexible sync turned on and it seems possibly related to writing to the database. We keep thinking we have the crash fixed, initially by ensuring certain operation move onto the main thread, but then I make a small adjustment to the code, and the crash comes back. At that point, rolling the code back does not resolve the issue. One time I observed that restarting my computer resolved the crash with the same version of code.

      Repro steps

      I'm really struggling to identify clear steps. At this point the possible related elements are

      • Flexible Sync
      • WriteAsync
      • I was trying to increment a RealmInteger, though removing this didn't solve the problem

      Version

      .Net Standard 2.0

      What SDK flavour are you using?

      MongoDB Atlas (i.e. Sync, auth, functions)

      What type of application is this?

      Unity

      Client OS and version

      Windows 11 Pro Build 22000.1098

      Code snippets

      await realmProp.Value.WriteAsync(
          () =>
          {
              syncedPointRecord = realmProp.Value.Add((SyncedPointRecord) pointRecord, true);
          });
      

      Stacktrace of the exception/crash you're getting

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      If it does have to do with writing, this is the chunk of code that would be in the mix
      
      #
      await realmProp.Value.WriteAsync(
          () =>
          {
              syncedPointRecord = realmProp.Value.Add((SyncedPointRecord) pointRecord, true);
          });
      

      Relevant log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      The last logs we see in Editor.log looks like this 
      
      
      [Log] [] 2022-11-10 22:43:46.213 Debug: Connection[1]: Session[1]: Received: DOWNLOAD(download_server_version=38, download_client_version=22, latest_server_version=38, latest_server_version_salt=0, upload_client_version=38, upload_server_version=37, downloadable_bytes=0, last_in_batch=true, query_version=4, num_changesets=1, ...) []
      UnityEngine.StackTraceUtility:ExtractStackTrace ()
      UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
      Company.Core.CompanyLogger:Log_Internal (UnityEngine.LogType,string,object,UnityEngine.Object) (at Assets/Company/Core/CompanyLogger.cs:139)
      Company.Core.CompanyLogger:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at Assets/Company/Core/CompanyLogger.cs:215)
      UnityEngine.Logger:Log (UnityEngine.LogType,object)
      UnityEngine.Debug:Log (object)
      UnityUtils.UnityLogger:LogImpl (Realms.Logging.LogLevel,string)
      Realms.Logging.Logger:Log (Realms.Logging.LogLevel,string)
      Realms.Sync.AppHandle:HandleLogMessage (intptr,Realms.Native.PrimitiveValue,Realms.Logging.LogLevel)
      

      ```

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: