Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81077

[REG 5.13->5.14?] Crash on launch due to reference table overflow with more than ~512 resource files on Android 21

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.1, 5.15.0 Alpha
    • 5.14.0
    • Core: Resource System
    • None
    • Qt Creator 4.11.0
      macOS 10.14.6
    • Android
    • 3bbd21ccc40805fce3437cf95bb238fc52bbf026 (qt/qtbase/5.14.1)

    Description

      Android apps bundling more than around 512 resource files crash on launch with the following exception when run on API level 21:

      JNI ERROR (app bug): local reference table overflow (max=512)
      local reference table dump:
        Last 10 entries (of 512):
            511: 0x12d72aa0 java.lang.String "webkit/"
            510: 0x12d72aa0 java.lang.String "webkit/"
            509: 0x12d72900 java.lang.String "sounds/"
            508: 0x12d72860 java.lang.String "images/"
            507: 0x12d72700 java.lang.String "android_rcc_bund... (22 chars)
            506: 0x12d726e0 java.lang.String "99.txt"
            505: 0x12d726a0 java.lang.String "98.txt"
            504: 0x12d72660 java.lang.String "97.txt"
            503: 0x12d72620 java.lang.String "96.txt"
            502: 0x12d725e0 java.lang.String "95.txt"
        Summary:
            512 of java.lang.String (511 unique instances)
      

      It seems that local JNI references to strings containing the resource file names are not being released quickly enough.

      The exact number of resource files required to trigger this was 507 in our testing, as some string references are used by other components, which can be seen in the exception above where only the numbered .txt files are resource files.

      We did not see this issue with Qt 5.13, so we think it’s a regression. Running on API level 28 did not trigger the issue, even when using more resource files. We didn’t try other API levels so far.

      Steps to reproduce

      Run attached sample app on Android API level 21 (e.g. x86 or x86_64 emulator).

      The app contains 512 resource files which are bundled like this:

      resources.files += $$files("$$PWD/assets/*.txt")
      resources.path = /assets
      INSTALLS += resources
      

      Attachments

        1. QtReferenceTableOverflow.zip
          106 kB
          Frederik Seiffert

        Activity

          People

            taipan BogDan Vatra
            fseiffert Frederik Seiffert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: