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

Crash when concating two string inside QFile parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.15.2
    • None
    • Toradex Apalis IMX6 CPU module (dual NXP ARM Cortex A9)
    • Linux/Yocto

    Description

      I concat a string inside the QFile Constructor:

      ...
      enum : quint8
      {
          CHANNEL_WHEELBASEDSPEED = 3,
          CHANNEL_GROUNDBASEDSPEED = 2,
          CHANNEL_PTOSPEED = 4,
          CHANNEL_INWORKINDICATION = 0,
          CHANNEL_HITCHPOSITION = 1
      };
      ...
      QFile file("/sys/class/ME_BT4/io_controller/freq_channels/freq_channel_" + QString::number(CHANNEL_GROUNDBASEDSPEED));
      ...

      This results sometimes into a crash:

       

      Crash #1:
          reason: Segmentation fault
          context:     timestamp: 1149.4634250s after boot after boot (2023_10_16 13:10:18)
          register dump:
              R0        : 0x55f419e0 (falls into map: 0x55743000-0x55f43000 rwxp at offset: 0x7fe9e0)
              R1        : 0xd66458ea 
              R2        :        0x1 
              R3        :        0x0 
              R4        :        0x2 
              R5        :        0x0 
              R6        :        0xa 
              R7        :        0x0 
              R8        :        0xa 
              R9        : 0x55f419e0 (falls into map: 0x55743000-0x55f43000 rwxp at offset: 0x7fe9e0)
              SL        :       0x30 
              FP        :        0x0 
              IP        : 0x76890d9c (falls into map: 0x76888000-0x76893000 r--p /usr/lib/libQt5Core.so.5.15.2 at offset: 0x8d9c)
              SP        : 0x55f41850 (falls into map: 0x55743000-0x55f43000 rwxp at offset: 0x7fe850)
              LR        : 0x7652e131 (falls into map: 0x76453000-0x76879000 r-xp /usr/lib/libQt5Core.so.5.15.2 at offset: 0xdb131)
              PC        : 0x76539d1c (falls into map: 0x76453000-0x76879000 r-xp /usr/lib/libQt5Core.so.5.15.2 at offset: 0xe6d1c)
              CPSR      : 0x60070030 
              Trap      :        0xe 
              Error     :        0x5 
              OldMask   :        0x0 
              Addr      :        0x0     stacktrace:
              /usr/lib/libQt5Core.so.5      : [+0xe6d1c]:
              /usr/lib/libQt5Core.so.5      : [+0xdb130]:
              /usr/lib/libQt5Core.so.5      : [+0xdb35e]:
              /usr/lib/libQt5Core.so.5      : QString::number(long long, int)[_ZN7QString6numberExi+0x3b]:
              /usr/lib/libQt5Core.so.5      : QString::number(int, int)[_ZN7QString6numberEii+0x1f]:

      Could this be the same issue as reported in QTBUG-87603?

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            m4rth1 Marcel Thiele
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes