-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
<!--- Questions: If you have questions about how to use Realm, please ask on -->
<!--- StackOverflow: http://stackoverflow.com/questions/ask?tags=realm -->
<!--- We monitor the realm tag. -->
<!--- Feature Request: Just fill in the first two sections below. -->
<!--- Bugs: To help you as fast as possible with an issue please describe your issue -->
When opening a realm db with missing schema in one table, the exception thrown from realm reaches the catch block on Windows c# code, but on Linux and Mac, it never reaches the catch block (it crashes hard with SIGABORT)
SigabortOnMissingSchema.zip
<!--- and the steps you have taken to reproduce it in as much detail as possible. -->
Attached is the project with source code, pre-built binaries and sample realm db. Go to bin\Debug\netcoreapp3.1 sub-folder and execute:
dotnet SigabortOnMissingSchema.dll <full path of v6db.realm included>
Do this on all 3 environments - Linux, Mac and Windows.
You should see SIGABORT on Linux and Mac. You will see soft landing on Windows.
<Unable to render embedded object: File (--- Thanks for helping us help you) not found. -->
Goals
<!--- What are you trying to achieve? -->
Graceful exception handling across all environments
no hard SIGABORT crash on Linux and Mac
Expected Results
<!--- What did you expect to happen? -->
Hit my catch all exception block in C#
Actual Results
<!--- What happened instead? -->
Hard crash SIGABORT on Linux and Mac
<!--- e.g. the stack trace of a crash -->
Core dumps with following:
Unhandled exception. System.InvalidOperationException: No properties in LocationSettingsModel, has linker stripped it? See https://realm.io/docs/xamarin/latest/#linker-stripped-schema
at Realms.Schema.ObjectSchema.Builder.Build()
at Realms.Schema.RealmSchema.CreateFromObjectStoreSchema(Schema nativeSchema)
at Realms.RealmConfiguration.<>c_DisplayClass24_0.<CreateRealm>b_0(Schema nativeSchema)
at Realms.SharedRealmHandle.GetNativeSchema(Schema schema, IntPtr managedCallbackPtr)
at Realms.SharedRealmHandle.NativeMethods.get_schema(SharedRealmHandle sharedRealm, IntPtr callback, NativeException& ex)
at Realms.SharedRealmHandle.GetSchema(Action`1 callback)
at Realms.RealmConfiguration.CreateRealm(RealmSchema schema)
at Realms.Realm.GetInstance(RealmConfigurationBase config, RealmSchema schema)
at Realms.Realm.GetInstance(RealmConfigurationBase config)
at SigabortOnMissingSchema.Program.Main(String[] args) in /home/user/Documents/SigabortOnMissingSchema/Program.cs:line 30
Fatal error. Internal CLR error. (0x80131506)
at Realms.SharedRealmHandle+NativeMethods.get_schema(Realms.SharedRealmHandle, IntPtr, Realms.NativeException ByRef)
at Realms.SharedRealmHandle+NativeMethods.get_schema(Realms.SharedRealmHandle, IntPtr, Realms.NativeException ByRef)
at Realms.SharedRealmHandle.GetSchema(System.Action`1<Realms.Native.Schema>)
at Realms.RealmConfiguration.CreateRealm(Realms.Schema.RealmSchema)
at Realms.Realm.GetInstance(Realms.RealmConfigurationBase, Realms.Schema.RealmSchema)
at Realms.Realm.GetInstance(Realms.RealmConfigurationBase)
at SigabortOnMissingSchema.Program.Main(System.String[])
Aborted (core dumped)
Steps to Reproduce
<!--- What are steps we can follow to reproduce this issue? -->
Attached is the project with source code, pre-built binaries and sample realm db. Go to bin\Debug\netcoreapp3.1 sub-folder and execute:
dotnet SigabortOnMissingSchema.dll <full path of v6db.realm included>
Do this on all 3 environments - Linux, Mac and Windows.
You should see SIGABORT on Linux and Mac. You will see soft landing on Windows.
Code Sample
<!--- Please provide a code sample or test case that highlights the issue. -->
<!--- If relevant, include your model definitions. -->
<!--- For larger code samples, links to external gists/repositories are preferred. -->
<!--- Alternatively, you can share information confidentially via email at help@realm.io. -->
<Unable to render embedded object: File (--- Full projects that we can compile and run ourselves are ideal) not found. -->
Version of Realm and Tooling
Latest stable release Realm 4.3.0
- Realm Object Server Version: ? (you can see this as well in Studio once connected to a Realm instance)
- Flavor:
- [ ] Realm Cloud
- [ ] Self-Hosted
- Server OS & Version: ? (e.g. CentOS 6)
- Client SDK Version: ?
- Client OS & Version: ?