Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How does one debug libqtforandroid?
QtWS25 Last Chance

How does one debug libqtforandroid?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidlibqtforandroidqtforandroid
5 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sh-zam
    wrote on 28 Jun 2019, 16:48 last edited by
    #1

    I am having a crash in my app and the backtrace doesn't really tell much about the crash. So, I'm planing to step through libqtforandroid.so to find where it crashes.

    ********** Crash dump: **********
    Build fingerprint: 'samsung/gts4lltedd/gts4llte:9/PPR1.180610.011/T835DDU2BSD1:user/release-keys'
    pid: 11765, tid: 11765, name: org.kde.krita  >>> org.kde.krita <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18
    Stack frame #00 pc 0002d168  /data/data/org.kde.krita/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
    

    But, when I set a breakpoint on any symbol in libqtforandroid.so it isn't found (I have compiled it with debug symbols). I can step through other Qt libraries like libQt5Gui.so but not libqtforandroid.so.
    It doesn't help when I run it using lldb. Only one frame is returned (other frames don't give something meaningful either) in the backtrace:

    (lldb) bt
    * thread #1, name = 'org.kde.krita', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
      * frame #0: 0xca533168
    

    So, what am I doing wrong? What should I do to be able to step through libqtforandroid.so in lldb?

    J 1 Reply Last reply 1 Jul 2019, 05:17
    0
    • M Offline
      M Offline
      mvuori
      wrote on 28 Jun 2019, 21:49 last edited by
      #2

      I have no idea. But according to one post in StackOverflow one reason is that "A page was accessed that is not even mapped into the address space of the application at all. This will often result from dereferencing a null pointer or a pointer that was corrupted with a small integer value. This is reported as SEGV_MAPERR."

      So you should be able to find out where the crash happens in your code by traditional debugging techniques and check your pointers (and other problems). The assumption being that if the problem is in your code, it can be found in your code.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sh-zam
        wrote on 29 Jun 2019, 17:19 last edited by
        #3

        If the problem is with my code, I should have a proper backtrace (I think). But, the problem is only one frame is returned which makes this problem so much harder to solve.

        PS: I've disabled optimizations as well.

        1 Reply Last reply
        0
        • S sh-zam
          28 Jun 2019, 16:48

          I am having a crash in my app and the backtrace doesn't really tell much about the crash. So, I'm planing to step through libqtforandroid.so to find where it crashes.

          ********** Crash dump: **********
          Build fingerprint: 'samsung/gts4lltedd/gts4llte:9/PPR1.180610.011/T835DDU2BSD1:user/release-keys'
          pid: 11765, tid: 11765, name: org.kde.krita  >>> org.kde.krita <<<
          signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18
          Stack frame #00 pc 0002d168  /data/data/org.kde.krita/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
          

          But, when I set a breakpoint on any symbol in libqtforandroid.so it isn't found (I have compiled it with debug symbols). I can step through other Qt libraries like libQt5Gui.so but not libqtforandroid.so.
          It doesn't help when I run it using lldb. Only one frame is returned (other frames don't give something meaningful either) in the backtrace:

          (lldb) bt
          * thread #1, name = 'org.kde.krita', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
            * frame #0: 0xca533168
          

          So, what am I doing wrong? What should I do to be able to step through libqtforandroid.so in lldb?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 1 Jul 2019, 05:17 last edited by
          #4

          @sh-zam said in How does one debug libqtforandroid?:

          Stack frame #00 pc 0002d168 /data/data/org.kde.krita/qt-reserved-files/plugins/platforms/android/libqtforandroid.so

          There should be more in the stack trace.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply 1 Jul 2019, 09:45
          0
          • J jsulm
            1 Jul 2019, 05:17

            @sh-zam said in How does one debug libqtforandroid?:

            Stack frame #00 pc 0002d168 /data/data/org.kde.krita/qt-reserved-files/plugins/platforms/android/libqtforandroid.so

            There should be more in the stack trace.

            S Offline
            S Offline
            sh-zam
            wrote on 1 Jul 2019, 09:45 last edited by
            #5

            @jsulm I'm afraid, what do you mean?

            This is the stack trace and as previously said, only one frame is returned :(

            (lldb) bt all
            * thread #1, name = 'org.kde.krita', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
              * frame #0: 0xca5bb168
              thread #2, name = 'Jit thread pool'
                frame #0: 0xe8d35f7c libc.so`syscall + 28
                frame #1: 0xe7828f96 libart.so`art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 82
                frame #2: 0xe7b09c8e libart.so`art::ThreadPool::GetTask(art::Thread*) + 178
                frame #3: 0xe7b09550 libart.so`art::ThreadPoolWorker::Run() + 64
                frame #4: 0xe7b09184 libart.so`art::ThreadPoolWorker::Callback(void*) + 96
                frame #5: 0xe8d90092 libc.so`__pthread_start(void*) + 24
                frame #6: 0xe8d3a4d2 libc.so`__start_thread + 26
              thread #3, name = 'Signal Catcher'
            ......
            
            1 Reply Last reply
            0

            1/5

            28 Jun 2019, 16:48

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved