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

QStorageInfo is completely broken with NDK r10e

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.10.1, 5.11.0, 5.11.1
    • Core: I/O
    • None
    • Qt 5.11.1 android
      Google Nexus 7 (android 6.0)
    • Android

    Description

      The QStorageInfo dos not return correct info, bytesFree(), bytesTotal(), bytesAvailable() all returns 0.

      This is the same issue as QTBUG-69173.

      As I explained in QTBUG-69173, the main cause is QStorageInfo is using 

      _PATH_MOUNTED by include <paths.h>, but the value is defined differently in NDK r10e and more recent NDK.

       

      in <NDK-r10e>/platforms/android-16/arch-arm/usr/include/paths.h (all other api levels has the same value)

      #define _PATH_MOUNTED "/etc/mtab"
      

      in <recent-NDK>/sysroot/usr/include/paths.h

      #define _PATH_MOUNTED "/proc/mounts"
      

      Since qt installer binary is built with NDK r10e, we are stuck with "/etc/mtab".

      The problem is most android devices do not have "/etc/mtab", I have tested this with Google's Nexus 7, and it certainly does not have /etc/mtab.

      QStorageInfo used to work normally, but suddenly failed with newer Qt release. The fix should be simple, just hardcode _PATH_MOUNTED to "/proc/mounts", something like:

      #ifdef Q_OS_ANDROID
      #undef _PATH_MOUNTED
      #define_PATH_MOUNTED "/proc/mounts"
      #endif

      But since the developer keep resist making the changes, maybe it is time to move NDK to a more recent release?

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              steve.k.chiu Steve K. Chiu
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes