Crash on QNX environment



  • Hello,

    My application is crashing with the following message. I assume this crash is happening in QHash while clearing it. Can some one help me what is this crash message means?
    Process xxxxxxx (XXXXXXXXX) terminated SIGSEGV code=1 fltno=11 ip=79cd9dbc(/lib/libQt5Core.so.5.3.1@_ZN9QHashData11free_helperEPFvPNS_4NodeEE+0x33) mapaddr=000d9dbc. ref=00000000

    Environment:
    Target OS : QNX
    Qt Version : 5.3.1

    Any suggestion to avoid this will be great help!!
    Thanks in advance for your help.


  • Qt Champions 2018

    @Yaswanth SIGSEGV usually means dereferencing invalid pointers.
    With the information you provided it is impossible to say why this happens.
    You need to run your app through a debugger and post the stack trace.



  • @jsulm
    Thanks for your reply.

    I can not run with debugger due to some limitations.

    SIGSEGV occur when the program tries to write/read outside the memory allocated for it or when writing memory which can only be read. But my question is, is QHash crashing application? Anybody encountered this message anytime?

    Thanks for your reply.


  • Qt Champions 2018

    @Yaswanth I doubt that QHash itself is the problem here, it is most probably your application that is doing something wrongly, but without farther information it is simply impossible to say more.
    If you can't use debugger you should at least add some "qDebug() << "...";" output to your app to locate the place where it is crashing.



  • @jsulm

    Thanks for your reply.

    By using debug statements, last log was before calling a function to clear Qhash.
    I have listmodel(QAbstractListModel) which is having QHash<QPair<uint64_t, uint16_t>, int> someHash.

    I am trying to clear QHash and model in a function.

    Ex:

    void clearData()
    {
    someHash.clear();
    removeAllElementsFromModel();//clears the listmodel.
    }
    

    Did you see any issue with above?

    Thanks in advance for your reply.


  • Qt Champions 2018

    @Yaswanth Where exactly is the crash? Is it inside removeAllElementsFromModel() ? If so what is inside removeAllElementsFromModel()?



  • @jsulm
    Crash in on calling clearData() but removeAllElementsFromModel() does not have any issues.

    I am calling clearData() even there is no data in QHash. Does it have any issues?


  • Qt Champions 2018

    @Yaswanth said in Crash on QNX environment:

    Crash in on calling clearData()

    Do you mean your app crashes when calling it even without its content being executed?
    Can you show the relevant code and the EXACT line where it is crashing?
    Because I still don't understand where exactly it is crashing.



  • @jsulm 'Do you mean your app crashes when calling it even without its content being executed?'
    Yes, QHash does not have any items in it and 'clear()' function is called.

    Is there any possibility that QHash which is created in Listmodel can cause for crash on clearing listmodel items?

    Unfortunately, I can not share code, where I can reproduce the issue. Really sorry for that.

    Thanks in advance for your reply.


  • Qt Champions 2018

    @Yaswanth said in Crash on QNX environment:

    Is there any possibility that QHash which is created in Listmodel can cause for crash on clearing listmodel items?

    Very unlikely.
    And I still do not know in which line EXACTLY your app is crashing.
    It is here:

    someHash.clear();
    

    or here

    removeAllElementsFromModel();
    

    ?



  • @jsulm
    I am thankful to you for reply.

    This issue occurs rarely.
    As mentioned, I have a function like this,

    void clearData()
    {
    someHash.clear();
    removeAllElementsFromModel();//clears the listmodel.
    }
    

    Before calling this function, I have a log message and that is the last log printed. After that application is terminated with following message,

    Process xxxxxxx (XXXXXXXXX) terminated SIGSEGV code=1 fltno=11 ip=79cd9dbc(/lib/libQt5Core.so.5.3.1@_ZN9QHashData11free_helperEPFvPNS_4NodeEE+0x33) mapaddr=000d9dbc. ref=00000000

    I assumed, due to clearing of QHash application is crashed.

    So, I am also not sure application is terminated on someHash.clear(); or removeAllElementsFromModel();

    More over, I am not trying to use QHash in any threads.

    If you feel some thing is wrong or if you have encountered similar situation please share your inputs.

    Can't we get any info from (/lib/libQt5Core.so.5.3.1@_ZN9QHashData11free_helperEPFvPNS_4NodeEE+0x33) ?

    Thanks in advance for your reply.


  • Qt Champions 2018

    @Yaswanth Please run your app through debugger until it crashes and post the stack trace, else we will discuss this forever.


Log in to reply