realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
962 stars 61 forks source link

Abort message: 'JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0x20 #1831

Open Zuhad777 opened 2 months ago

Zuhad777 commented 2 months ago

How frequently does the bug occur?

Always

Description

We get the data from server , We intend to save the data in RealmDataBase - when we try to store the value in copytoRealm function - the application crashes and throws below error.

string: 'Failure when converting long string to UTF-16 error_code = 1; retcode = 0; StringData.size = 138; StringData.data = DB: 64104 Thread 468619435184: Set 'jsonData' to "{"author":"Mary Elizabeth Dallas","htmlBody":"\u003cp\u003eBlood pressure that? ...”;

Data coming from server : {"author":"Mary Elizabeth Dallas","htmlBody":"\u003cp\u003eBlood pressure that’s It get's crashes in aphastrophe.

In another instance - These character crashes.

Screenshot 2024-09-06 at 11 22 30 PM

I don't see , any solution on this so far. I refrered #7101 looks like its still in progress.

And also if i change to another language for example HINDI - Its get crashes.

Facing multiple crashes with same error in log. But for different character.

please let me know , if anyone has any solution for it.

Stacktrace & log output

string: 'Failure when converting long string to UTF-16 error_code = 1; retcode = 0; StringData.size = 138; StringData.data = DB: 64104 Thread 468619435184:    Set 'jsonData' to "{"author":"Mary Elizabeth Dallas","htmlBody":"\u003cp\u003eBlood pressure that? ...”; 

StringData as hex =  0x44 0x42 0x3a 0x20 0x36 0x34 0x31 0x30 0x34 0x20 0x54 0x68 0x72 0x65 0x61 0x64 0x20 0x34 0x36 0x38 0x36 0x31 0x39 0x34 0x33 0x35 0x31 0x38 0x34 0x3a 0x20 0x20 0x20 0x20 0x53 0x65 0x74 0x20 0x27 0x6a 0x73 0x6f 0x6e 0x44 0x61 0x74 0x61 0x27 0x20 0x74 0x6f 0x20 0x22 0x7b 0x22 0x61 0x75 0x74 0x68 0x6f 0x72 0x22 0x3a 0x22 0x4d 0x61 0x72 0x79 0x20 0x45 0x6c 0x69 0x7a 0x61 0x62 0x65 0x74 0x68 0x20 0x44 0x61 0x6c 0x6c 0x61 0x73 0x22 0x2c 0x22 0x68 0x74 0x6d 0x6c 0x42 0x6f 0x64 0x79 0x22 0x3a 0x22 0x5c 0x75 0x30 0x30 0x33 0x63 0x70 0x5c 0x75 0x30 0x30 0x33 0x65 0x42 0x6c 0x6f 0x6f 0x64 0x20 0x70 0x72 0x65 0x73 0x73 0x75 0x72 0x65 0x20 0x74 0x68 0x61 0x74 0xe2 0x80 0x20 0x2e 0x2e 0x2e 0x22; in_begin = ? ..."; in_end = ; out_curr = 0xb400006fcad4f096; out_end = 0xb400006fcad4f100;’

Can you reproduce the bug?

Always

Reproduction Steps

When we try to store the data into database via copyToRealm()

Version

Android 14 ( English language)

What Atlas App Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

Samsung Galaxy A54 - 5G device , Android version 14 , One UI version 6.0

Build environment

Android Studio version: ... Android Build Tools version: ... Gradle version: ...

sync-by-unito[bot] commented 2 months ago

➤ PM Bot commented:

Jira ticket: RKOTLIN-1126