#553 Assertion in latexdocument.cpp causes system crash

closed
nobody
None
7
2012-10-17
2012-06-20
No

An assertion in latexdocument.cpp, line 1302 (SVN revno 2967) fires frequently. After this, the CPU consumption of both texstudio and Xorg rises to almost 100%. Terminating texstudio does not help, and Xorg never recovers -- I have to restart the window manager.

I would be glad to help tracing the error, but for now I have turned off the assertions. Is there a logging facility?

Ubuntu 12.04 Precise, Unity 2D, current updates.

Discussion

  • Benito van der Zander

    Can you reproduce the error?
    How does the displayed structure tree look?
    Are you opening/closing many documents?

    The assert in line 1302 fails, if there are elements in the structure
    tree that are not part of any open document.

    And even if it fails, it shouldn't crash everything.

    Do you get a message like:

    TeXstudio has CRASHED due to a Assert failure: false at something in
    latexdocument.cpp:1302.

    Do you want to keep it running? This may cause data corruption.

    Is there a logging facility?
    Not really.
    But it will print a backtrace, if you run it from a terminal

    On 06/20/12 16:07, SourceForge.net wrote:

    Bugs

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    I have a rather complicated file hierarchy, and the error usually occurs when several documents are open. The error occurs sporadically, and, what is worse, even with the assertion removed. I'll keep you posted.

    Yes, this message is produced by Q_ASSERT, I assume.

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    Updaet: I'm getting lots of messages like this to the console:

    Structure broken! 0x23c6890
    Structure broken! 0x26b1520
    Structure broken! 0x23c6890
    Structure broken! 0x26b1520
    Structure broken! 0x23c6890

     
  • Benito van der Zander

    is worse, even with the assertion removed. I'll keep you posted.

    But then it is a different error?

    Structure broken! 0x23c6890

    That doesn't say anything.

    I changed the error message, what does it say in r2968?

    Yes, this message is produced by Q_ASSERT, I assume.

    Not really, it is some complicated assert catcher,
    usually Q_ASSERT just kills the application

    So you click "Recover", and Xorg freezes/crashes immediately?

    Or does the message box appears several times?

    On 06/20/12 18:16, SourceForge.net wrote:

    Bugs

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-06-20

    Because there's also the Q_ASSERT(found) issue, I added another debug message for that case (rev 2969).

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    Just had a crash of TeXstudio. The command line says:

    No document for entry: 0x38dd7f0
    level: 20352512
    type: 0
    line nr: -728271328
    crashed with signal SIGSEGV
    Segmentation fault (core dumped)

    I have now switched to GNOME shell, and I also have the two Q_ASSERT calls disabled. In this particular routine, any failing Q_ASSERT call used to freeze Xorg (at least in Unity 2D), I didn't even have a chance to click on "Proceed".

    My document consists mainly of files autogenerated by knitr (extension .Rtex), with a rather small static outline. The crash occurred when some of the .Rtex files were open in TeXstudio during a regeneration of the .Rtex files.

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    One more crash.

    Opened all autogenerated files in TeXstudio, opened preview, started full rebuild. Full console output:

    16 2 37
    .../recode.Rtex modified.
    .../recode.Rtex modified.
    .../create.Rtex modified.
    .../create.Rtex modified.
    No document for entry: 0x489e5c0
    level: 7798752
    type: 0
    line nr: 96
    crashed with signal SIGSEGV
    Segmentation fault (core dumped)

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    A new one, with just two .Rtex files open and with several recompilation runs during the session:

    .../person-desc.Rtex modified.
    16 2 37
    .../create.Rtex modified.
    .../create.Rtex modified.
    No document for entry: 0x3847fe0
    level: 1836017711
    type: 0
    line nr: 1664054133
    crashed with signal SIGSEGV
    No document for entry: 0x3847fe0
    level: 0
    type: 0
    line nr: 0
    title:
    No document for entry: 0x3847fe0
    level: 0
    type: 0
    line nr: 0
    glibc detected texstudio: corrupted double-linked list: 0x00000000036b3590 ***
    Main thread in trouble
    Main thread in trouble
    Main thread in trouble
    (repeated indefinitely)

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-06-20

    I don't have time to look into the code, so it's just guessing:

    Your files end on .Rtex instead of .tex. It might, there is a check for the file extension when (re)building the structure.
    You could temporarily rename the the documents to .tex and see if it works the.?

     
  • Kirill Müller

    Kirill Müller - 2012-06-20

    Sorry, there's too much that depends on the files being named .Rtex. Perhaps we can track the error through logging?

     
  • Benito van der Zander

    You could temporarily rename the the documents to .tex and see if it works
    the.?
    I doubt that makes a difference.

    The error occurs probably, because the reload is triggered, before that
    knitr has written the complete file, so the file is repeatedly reloaded.

    I could reproduce a SIGSEGV in that case in the syntax checker.

    You can try to disable the syntax checking.

    And if it still happens, you could run it with gdb to get a better
    stacktrace

    On 06/21/12 00:04, SourceForge.net wrote:

    Bugs

     
  • Kirill Müller

    Kirill Müller - 2012-06-21

    Here you go:

    .../uncensor.Rtex modified.
    No document for entry: 0x1512ad0
    level: 1
    type: -150830672
    line nr: 96

    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000448419 in QBasicAtomicInt::ref (this=0x0) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121
    121 : "memory");
    (gdb) bt

    0 0x0000000000448419 in QBasicAtomicInt::ref (this=0x0) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121

    1 0x00000000004484a2 in QString::QString (this=0x7fffffffb100, other=...) at /usr/include/qt4/QtCore/qstring.h:726

    2 0x0000000000651326 in StructureEntry::debugPrint (this=0x1512ad0, message=0x8eb40a "No document for entry:") at latexdocument.cpp:1127

    3 0x0000000000652931 in LatexDocumentsModel::parent (this=0xfd3450, index=...) at latexdocument.cpp:1312

    4 0x00007ffff5ce8c45 in QAbstractItemModelPrivate::rowsAboutToBeInserted(QModelIndex const&, int, int) ()

    from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    5 0x00007ffff5cebe08 in QAbstractItemModel::beginInsertRows(QModelIndex const&, int, int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    6 0x0000000000652fff in LatexDocumentsModel::addElement (this=0xfd3450, se=0x2e82000, row=0) at latexdocument.cpp:1401

    7 0x00000000008351dd in LatexDocumentsModel::qt_static_metacall (_o=0xfd3450, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fffffffb470)

    at .moc/moc_latexdocument.cpp:419
    

    8 0x00007ffff5d06281 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    9 0x0000000000834e82 in LatexDocument::addElement (this=0x1b8c120, _t1=0x2e82000, _t2=0) at .moc/moc_latexdocument.cpp:309

    10 0x000000000065745d in LatexDocument::insertElementWithSignal (this=0x1b8c120, parent=0x2e82000, pos=0, se=0x20a47a0)

    at latexdocument.cpp:1826
    

    11 0x000000000064d595 in LatexDocument::patchStructure (this=0x1b8c120, linenr=0, count=378) at latexdocument.cpp:742

    12 0x000000000048a6e8 in Texmaker::fileReloaded (this=0xfca800) at texmaker.cpp:1675

    13 0x0000000000828d0a in Texmaker::qt_static_metacall (_o=0xfca800, _c=QMetaObject::InvokeMetaMethod, _id=257, _a=0x7fffffffc9b0)

    at .moc/moc_texmaker.cpp:914
    

    14 0x00007ffff5d06281 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    15 0x00000000008402e5 in QEditor::fileReloaded (this=0xdd4aa0) at .moc/moc_qeditor.cpp:540

    16 0x00000000006ffd8a in QEditor::fileChanged (this=0xdd4aa0, file=...) at qcodeedit/lib/qeditor.cpp:1093

    17 0x000000000083f53f in QEditor::qt_static_metacall (_o=0xdd4aa0, _c=QMetaObject::InvokeMetaMethod, _id=89, _a=0x7fffffffce30)

    at .moc/moc_qeditor.cpp:365
    

    18 0x00007ffff5cf9f01 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    19 0x00007ffff5cfc210 in QMetaObject::invokeMethod(QObject, char const, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGe---Type <return> to continue, or q <return> to quit---

    nericArgument) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    20 0x00000000006c994e in QMetaObject::invokeMethod (obj=0xdd4aa0, member=0x8f5ed6 "fileChanged", val0=..., val1=..., val2=..., val3=...,

    val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at /usr/include/qt4/QtCore/qobjectdefs.h:434
    

    21 0x0000000000729b58 in QReliableFileWatch::timerEvent (this=0x1507750, e=0x7fffffffdbc0) at qcodeedit/lib/qreliablefilewatch.cpp:147

    22 0x00007ffff5d0b179 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    23 0x00007ffff6560894 in QApplicationPrivate::notify_helper(QObject, QEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4

    24 0x00007ffff6565713 in QApplication::notify(QObject, QEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4

    25 0x00007ffff5cf1e9c in QCoreApplication::notifyInternal(QObject, QEvent) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    26 0x00007ffff5d231f2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    27 0x00007ffff5d20c0d in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    28 0x00007ffff5d20c31 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    29 0x00007ffff4294d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    30 0x00007ffff42950a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    31 0x00007ffff4295164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    32 0x00007ffff5d213bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()

    from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    33 0x00007ffff6608d5e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4

    34 0x00007ffff5cf0c82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    35 0x00007ffff5cf0ed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    36 0x00007ffff5cf5f67 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    37 0x000000000044b534 in main (argc=1, argv=0x7fffffffe108) at main.cpp:176

     
  • Kirill Müller

    Kirill Müller - 2012-06-21

    It seems to me that the error occurs when accessing title in void StructureEntry::debugPrint(const char* message) const. Any chance that StructureEntry::title gets corrupted somehow?

     
  • Benito van der Zander

    Any chance that StructureEntry::title gets corrupted somehow?
    Yes, that seems to be what happens.

    The entire structure entry is corrupted, also "type: -150830672"
    shouldn't happen (type is always >= 0)

    So it still happens, if the syntax checking is disabled?

    On 06/21/12 12:33, SourceForge.net wrote:

    Bugs

     
  • Benito van der Zander

    Anything new?

     
  • Benito van der Zander

    Closed: the changed backtrace function should fix the system crash, and the fixed document moving bug might fix the structureview/assert issue

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks