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

Mem corruption will soon cause all android apps to die immediately.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.3.1
    • 5.0.2, 5.1.1, 5.2.1, 5.3.0 RC1
    • QPA
    • None
    • Android
    • 849f8f58ce8eb58b80ea6ffeda0a9ea77898e437

    Description

      Future releases of the android OS will have an upgraded, more standard version of libc. This bug addresses a particular call to putenv() in androidjnimain.cpp that, if it not fixed, will cause ALL Qt programs to die on startup without even a trace.

      The offending line is here:
      https://qt.gitorious.org/qt/qtbase/source/cfcbb957c7ee85decee3379d8876a7b4094ae501:src/plugins/platforms/android/androidjnimain.cpp#L471

      The putenv() function puts the passed-in string into the environment. This string must by definition be static and only changed afterwards if you actually wish to change the environment. If you look here, though, you see that the variable's memory is reused:
      https://qt.gitorious.org/qt/qtbase/source/cfcbb957c7ee85decee3379d8876a7b4094ae501:src/plugins/platforms/android/androidjnimain.cpp#L479

      The way this manifests in yet-to-be-released versions of android is for the program to simply die, as mentioned above.

      Probably the best solution for this would be to use setenv() instead and can the static memory (declared as m_applicationParams) completely.

      Attachments

        Issue Links

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

          Activity

            People

              stromme Christian
              shantzis62 Michael Shantzis
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes