Skip to content
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

Importing ZIP containing newer emoji on older platform crashes XML parsing #360

Open
TWiStErRob opened this issue Oct 21, 2023 · 0 comments
Labels
a:bug something isn't working as expected in:import Backup > Import
Milestone

Comments

@TWiStErRob
Copy link
Owner

TWiStErRob commented Oct 21, 2023

art/runtime/check_jni.cc:65
JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf0
    string: 'Trainline Tango 🤜🤛 Bonsai T-shirt (Black, M)'
    in call to NewStringUTF
    from java.lang.String org.apache.harmony.xml.ExpatAttributes.getValueForQName(long, java.lang.String)
"AsyncTask #4" prio=5 tid=23 Runnable
  | group="main" sCount=0 dsCount=0 obj=0x132897a0 self=0x7fbe271a9000
  | sysTid=2591 nice=10 cgrp=apps/bg_non_interactive sched=0/0 handle=0x7fbe153ecf00
  | state=R schedstat=( 0 0 0 ) utm=591 stm=170 core=1 HZ=100
  | stack=0x7fbe13ffe000-0x7fbe14000000 stackSize=1036KB
  | held mutexes= "mutator lock"(shared held)
  native: #00 pc 00006c19  /system/lib64/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned long, ucontext*)+57)
  native: #01 pc 0038aa50  /system/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char
                                                                                                   const*, art::mirror::ArtMethod*)+96)
  native: #02 pc 0035a617  /system/lib64/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+215)
  native: #03 pc 0010e1c3  /system/lib64/libart.so (art::JniAbort(char const*, char const*)+947)
  native: #04 pc 0010f13c  /system/lib64/libart.so (art::JniAbortF(char const*, char const*, ...)+220)
  native: #05 pc 00113706  /system/lib64/libart.so (art::ScopedCheck::Check(bool, char const*, ...) (.constprop.132)+1686)
  native: #06 pc 001196c0  /system/lib64/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+64)
  native: #07 pc 00049aef  /system/lib64/libjavacore.so (???)
  native: #08 pc 002e34d8  /data/dalvik-cache/x86_64/system@[email protected] (Java_org_apache_harmony_xml_ExpatAttributes_getValueForQName__JLjava_lang_String_2+208)
  at org.apache.harmony.xml.ExpatAttributes.getValueForQName(Native method)
  at org.apache.harmony.xml.ExpatAttributes.getValue(ExpatAttributes.java:138)
  at net.twisterrob.inventory.android.backup.xml.XMLImporter$BaseElementListener.start(XMLImporter.java:153)
  at net.twisterrob.inventory.android.backup.xml.XMLImporter$ItemElementListener.start(XMLImporter.java:301)
  at android.sax.RootElement$Handler.start(RootElement.java:158)
  at android.sax.RootElement$Handler.startElement(RootElement.java:134)
  at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:143)
  at org.apache.harmony.xml.ExpatParser.appendBytes(Native method)
  at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
  at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
  at android.util.Xml.parse(Xml.java:84)
  at net.twisterrob.inventory.android.backup.xml.XMLImporter.doImport(XMLImporter.java:49)
  at net.twisterrob.inventory.android.backup.importers.BackupZipStreamImporter.importFrom(BackupZipStreamImporter.java:80)
  at net.twisterrob.inventory.android.backup.importers.BackupZipUriImporter.importStream(BackupZipUriImporter.java:44)
  at net.twisterrob.inventory.android.backup.importers.BackupZipUriImporter.importFrom(BackupZipUriImporter.java:32)
  at net.twisterrob.inventory.android.backup.importers.BackupZipUriImporter.importFrom(BackupZipUriImporter.java:16)
  at net.twisterrob.inventory.android.backup.importers.BackupTransactingImporter.importFrom(BackupTransactingImporter.java:35)
  at net.twisterrob.inventory.android.backup.concurrent.BackupService.importFrom(BackupService.java:232)
  at net.twisterrob.inventory.android.backup.concurrent.BackupService.onHandleWork(BackupService.java:206)
  at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:396)
  at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:387)
  at android.os.AsyncTask$2.call(AsyncTask.java:288)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:818)
art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf0
23:28:19.126  2824-2854  art                     net.twisterrob.inventory.debug                 A  art/runtime/check_jni.cc:65]     string: 'I 💓 Reading Buses Pin Badge x2'
23:28:19.126  2824-2854  art                     net.twisterrob.inventory.debug                 A  art/runtime/check_jni.cc:65]     in call to NewStringUTF
23:28:19.126  2824-2854  art                     net.twisterrob.inventory.debug                 A  art/runtime/check_jni.cc:65]     from java.lang.String org.apache.harmony.xml.ExpatAttributes.getValueForQName(long, java.lang.String)

Relevant XML snippets:

<item id="1397" name="Trainline Tango &#129308;&#129307; Bonsai T-shirt (Black, M)" type="category_top" image="item_1397_20221229_211020.jpg" />
<item id="3072" name="I &#128147; Reading Buses Pin Badge x2" type="category_jewelry" image="item_3072_20190130_145354.jpg" />

but this works:

<item id="3077" name="I ❤ London Small Umbrella Case" type="category_case" image="item_3077_20150904_142530.jpg">
@TWiStErRob TWiStErRob added a:bug something isn't working as expected in:import Backup > Import labels Oct 21, 2023
@TWiStErRob TWiStErRob added this to the v1.3.0 milestone Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug something isn't working as expected in:import Backup > Import
Projects
None yet
Development

No branches or pull requests

1 participant