Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

TeXstudion bug when partition is full

Tricolore
2012-07-10
2012-10-17
  • Tricolore
    Tricolore
    2012-07-10

    I have to report a bug that made me quite angry to discover, today. When
    trying to compile one of my documents, TeXstudio suddenly crashed (a windows
    message said TeXstudio had stopped working). Checking one of my tex files used
    in the document, I noticed that it was empty. Completely empty, 0 bytes.
    Luckily, I had only changed very little in it since I last time committed it
    to my git repository. So I went to the repository, copied all of the text and
    pasted it into the file and saved it, but the file was still empty. Then I
    noticed the partition the document was saved on was full. After having made
    som space available on the partition I could restore the committed version of
    the text file and recompile the document. It still didn't compile. I checked
    the other files and noticed that another of the files was empty. This was less
    fun, since I had written a lot in that file since I last committed it. Anyway,
    TeXstudio apparently saves empty files for some reason, when the partition the
    file is saved on is almost full. Instead, TeXstudio should just leave the file
    as it is and give the user a warning that there is too little space on the
    partition for saving the file.

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-07-11

    Sorry for the data loss. We are continually improving TXS and making it more
    stable.

    TeXstudio doesn't "save" empty files. It's the result when you open a file for
    writing, but the actual write fails. I already applied some more safeguards to
    the file writing process. Pease help by providing additional information:
    - Which OS and version of TXS are you using?
    - Do you rememeber, which Save action you used? Save / SaveAs / Automatically when compiling
    - Did you receive any error message about the failed saving?
    - Can you give a step-by-step guide to reproduce the crash?

     
  • Tricolore
    Tricolore
    2012-07-12

    • I'm using Windows 7 and TeXstudio 2.3 (SVN 2471).
    • I tried to compile and then the file saved automatically.
    • I didn't receive any error message saying that the saving had failed, but the program froze while trying to compile and then it crashed and Windows said the program had stopped working.
    • I don't want to reproduce it on my own computer, but I guess it should work to just fill the partition until it's full, tentatively by downloading some large files with a bittorrent client until the partition is full, and then try to use TeXstudio to compile a LaTeX project in which a file has been modified which TeXstudio therefore has to save. Maybe the new version of the file its trying to save also has to be larger than the old version.
     
  • Tim Hoffmann
    Tim Hoffmann
    2012-07-13

    Ok. We now check the available disk space (currently only on win) before
    writing. Still there can be other reasons for a failed write, that can corrupt
    existing data. In such a case you will be notified.

    For the tests I used a small ramdisk. I could reproduce the zero-byte files,
    which is now fixed (see above). However I could not reproduce a crash.It may
    not be directly related to the full disk.

     
  • Still there can be other reasons for a failed write, that can corrupt
    existing
    data.
    Saving it first in a temporary file could solve them all

    However I could not reproduce a crash

    Here is a crash that (sometimes) can occur on saving:

    somehow create /tmp/x.tex content: fya\n
    load /tmp/x.tex
    replace "fya" => " fyasim\n"
    save
    $ echo fya > /tmp/x.tex
    reloaded: no
    diff: ok |small error: unmodified, text in editor: "
    fyasim"
    replace content: => "fya"
    save:save
    $ echo fya > /tmp/x.tex
    reloaded: no
    diff: ok
    replace content: => "fyasim\n"
    save:save
    => crash

    5 0x000000000044e91d in QBasicAtomicInt::ref (this=0x4cc9b2) at

    /usr/include/qt4/QtCore/qatomic_x86_64.h:121

    6 0x000000000044e9a6 in QString::QString (this=0x7fffb920d0d0,

    other=...) at /usr/include/qt4/QtCore/qstring.h:726

    7 0x0000000000742ec3 in QDocument::getFileName (this=0x3e0c750) at

    qcodeedit/lib/document/qdocument.cpp:888

    8 0x00000000007204b7 in QEditor::fileName (this=0x3d11400) at

    qcodeedit/lib/qeditor.cpp:3762

    9 0x0000000000712ef4 in QEditor::fileChanged (this=0x3d11400,

    file=...) at qcodeedit/lib/qeditor.cpp:1039

    10 0x0000000000858368 in QEditor::qt_static_metacall (_o=0x3d11400,

    _c=QMetaObject::InvokeMetaMethod, _id=89, _a=0x7fffb920d540) at
    ..moc/moc_qeditor.cpp:365

    11 0x00007f5e62605ff7 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

    12 0x00007f5e626083cc in QMetaObject::invokeMethod(QObject*, char

    const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument,
    QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,
    QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,
    QGenericArgument) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

    13 0x00000000006dbc82 in QMetaObject::invokeMethod (obj=0x3d11400,

    member=0x90bdb6 "fileChanged", val0=..., val1=..., val2=..., val3=...,
    val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at
    /usr/include/qt4/QtCore/qobjectdefs.h:434

    14 0x000000000073db6b in QReliableFileWatch::timerEvent

    (this=0x3017d10, e=0x7fffb920e260) at
    qcodeedit/lib/qreliablefilewatch.cpp:147

    15 0x00007f5e626128dc in QObject::event(QEvent*) () from

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

    16 0x00007f5e62e7270c in QApplicationPrivate::notify_helper(QObject*,

    QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4

    17 0x00007f5e62e76b8a in QApplication::notify(QObject, QEvent) ()

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

    18 0x00007f5e625fdbde in QCoreApplication::notifyInternal(QObject*,

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

    19 0x00007f5e6262eac2 in ?? () from

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

    20 0x00007f5e6262bc84 in ?? () from

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

    21 0x00007f5e6262bca1 in ?? () from

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

    On 07/13/2012 01:09 PM, SourceForge.net wrote: