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

[qt-android] Crash when JNI is called from multipile threads

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.3.2, 5.4.0 Beta
    • Fix Version/s: 5.4.0 RC
    • Component/s: QPA
    • Labels:
      None
    • Environment:
      many android devices
    • Platform/s:
      Android
    • Commits:
      f9408cc81c7d3cb3fa212005fb30cd8318ebf247

      Description

      I have a qt5 android program which will call JNI code in multiple threads, it will randomly crashed, I found it crashed in getCachedMethodID() in qjni.cpp through core dump.
      It seems that getCachedMethodID() will access a global data structure JMethodIDHash, and it is totally un-protected from multi-threaded access. I think we should use a mutex to protect it.

        Attachments

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

          Activity

            People

            Assignee:
            stromme Christian
            Reporter:
            jianliang79 liang jian
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes