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. What is wrong here [A data abort exception has occurred]
Forum Updated to NodeBB v4.3 + New Features

What is wrong here [A data abort exception has occurred]

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 3.6k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    Tratstil
    wrote on last edited by
    #1

    hi everyone!
    did I do something wrong here?
    !http://files.myopera.com/tratstil/files/nokiaqt.png!

    1 Reply Last reply
    0
    • F Offline
      F Offline
      favoritas37
      wrote on last edited by
      #2

      Was the fileName null terminated? (The last character to be '\0')

      Also why do you want to do that operation by that way since there are plenty of easier ways by using QString methods. Just asking..not judging.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tratstil
        wrote on last edited by
        #3

        The filename is an element of an array of char like this
        @char* _ResourceFileName[] = {
        "tester",
        "ten"};
        filename = _ResourceFileName[1];@
        _ResourceFileName is static.

        At you see above, if filename is not end with '\0', the line "qDebug()<<"checkpoint1"<<filename" can't work correctly.

        And I must using char for some reason.

        Thanks for replying favoritas37.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris H
          wrote on last edited by
          #4

          If you step through this one line at a time in the debugger, does realname get set correctly?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tratstil
            wrote on last edited by
            #5

            thanks Chris H, it is interesting to try.
            I change my code to
            @extern "C" const char* GetRealFilePath(const char* filename){
            char realname[1024];
            qDebug()<<"checkpoint1:"<<filename;
            sprintf(realname,"%s",filename);
            qDebug()<<"checkpoint2";
            qDebug()<<"realname"<<realname;
            return NULL;
            }@
            and get
            @[Qt Message] start QtGame
            [Qt Message] application event: 68
            [Qt Message] \private%s\res\bin%s
            [Qt Message] \private\E57BFD88\res\bin%s
            [Qt Message] game init
            [Qt Message] runhere2: ten
            Process 2357, thread 2358 stopped at 0x504b46: A data abort exception has occurred.
            *[Qt Message] checkpoint1: ten
            [Qt Message] checkpoint2 *
            [Qt Message] realname ten @
            the realname is correct. But I don't know what happened. The error message above the checkpoint1, is it mean the bug is in another unsynchronize thread?

            I change the code to
            @extern "C" const char* GetRealFilePath(const char* filename){
            qDebug()<<"begin function";
            char realname[1024];
            qDebug()<<"checkpoint1:"<<filename;
            sprintf(realname,"%s",filename);
            qDebug()<<"checkpoint2";
            qDebug()<<"realname"<<realname;
            return NULL;
            }@
            and receive
            @[Qt Message] game init
            [Qt Message] runhere2: ten
            [Qt Message] begin function
            Process 2389, thread 2390 stopped at 0x504cda: A data abort exception has occurred.
            [Qt Message] checkpoint1: ten
            [Qt Message] checkpoint2
            [Qt Message] realname ten
            [Qt Message] @

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris H
              wrote on last edited by
              #6

              bq. is it mean the bug is in another unsynchronize thread?

              Yeah, that's the only thing that makes any sense here: I'd suggest running in a debugger that will let you see what thread is crashing, and what it's trying to do. I don't trust char * and friends in the least, but they may be totally unrelated to the problem here.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tratstil
                wrote on last edited by
                #7

                hum, more thing to do. You are right. I just return NULL without any code and get the same error message. It means this function not relative at all :D. Thanks you

                1 Reply Last reply
                0

                • Login

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