#666 Debug builds crash due to null pointer access

None
closed
nobody
None
1
2013-01-14
2013-01-01
No

The crash happens in QModelIndex LatexDocumentsModel::parent ( const QModelIndex & index ) (latexdocument.cpp:1344). The variable entry is accessed in the #ifndef QT_NO_DEBUG block even if it is NULL (which is checked only after this block). Presumably this doesn't happen with release builds.

Discussion

  • Benito van der Zander

    Do you have a way to reproduce the crash?

    The variable |entry| is accessed in the |#ifndef QT_NO_DEBUG| block
    even if it is NULL (which is checked only after this block).

    Actually this does not matter, since "entry->debugPrint" can be called
    even if entry is NULL, because debugPrint contains a check for that.

     
  • Kirill Müller

    Kirill Müller - 2013-01-02

    What about the Q_ASSERT(entry->document == found);?

    (I ran TeXstudio in gdb, it crashed right there. It doesn't crash there anymore since I moved the check for entry being NULL before the #ifndef.)

     
  • Kirill Müller

    Kirill Müller - 2013-01-02

    What about the Q_ASSERT(entry->document == found);?

    (I ran TeXstudio in gdb, it crashed right there. It doesn't crash there anymore since I moved the check for entry being NULL before the #ifndef.)

     
  • Benito van der Zander

    What about the |Q_ASSERT(entry->document == found);|?

    Okay, that will crash.

    However it is not supposed to happen. If entry is NULL, found should be
    NULL, and it should stop with an assert failure
    in the previous line ...

     
  • Tim Hoffmann

    Tim Hoffmann - 2013-01-02

    might be related to #667 there entry is not null but we seem to have an use-after-free.

     
  • Tim Hoffmann

    Tim Hoffmann - 2013-01-14

    assume fixed by rev 3625. Please report back if this should still be an issue.

     
  • Tim Hoffmann

    Tim Hoffmann - 2013-01-14
    • status: open --> closed
    • milestone: -->
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks