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

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.14.0
    • Fix Version/s: 5.14.1, 5.15.0 Alpha
    • Component/s: Core: Resource System
    • Labels:
      None
    • Environment:
      Qt Creator 4.11.0
      macOS 10.14.6
    • Platform/s:
      Android
    • Commits:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes