Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#150 gedit crashes when compiling without prior save

v0.2
open
nobody
Tools (28)
7
2011-05-10
2011-04-27
mikerofone
No

When invoking compilation after making some changes to the document, gedit often crashes without any message after finishing compilation.

How to reproduce the crash:
1) Open a preferrably larger .tex file
2) Compile it (I use internal preview)
3) Make a change
4) Invoke compile without explicitly saving manually before
5) After compilation finished, gedit dies in 20-60% of tries, or it completes normally. (If it dies, no message is displayed, and no output to terminal occurs.)

My guess is that document saving and compilation are started in parallel, leading to a race condition. I ran gedit using valgrind, which makes it run horribly slow. If then invoking any tool (Latex->internal PDF in my case), one can see that the compilation sets off and completes before the saving (which takes 5-10 seconds on a larger document) is done. I did not see any crashes using valgrind, probably because saving was so slow that there could not occur any conflicts. I guess this is also responsible for bug 3013644 (last changes not compiled), where I commented in the first place.

To reproduce the late-save:
1) execute "valgrind gedit"
2) open some tex file (should be some kb in size)
3) change something
4) invoke tool without saving before

Expected behaviour:
Saving completes, then tool is executed and gedit does not crash. Resulting PDF shows changes from step 3.

Actual:
Saving and tool execute simultaneously, tool finishes before saving. gedit may crash, or PDF reflects old, pre-save state of document.

Proposed fix:
Upon tool invocation, first invoke saving in gedit, then process tool after (successful?) completion of saving process.

Current workaround:
Before invoking tool, manually save and wait a few seconds. Then invoke tool/compilation. I did not notice any crashes then.

Version information:
gedit v2.30.4, latex-plugin 0.2

Discussion

  • mikerofone
    mikerofone
    2011-05-10

    I noticed that gedit also often crashes when I close the embedded preview, especially when working with multiple different files belonging to the same "master" document. I always use the embedded preview when working with the plugin, so perhaps the crash is related to the preview pane? Seems to happen exactly when the panel tries to update (after compiling) or gets destroyed (closing preview pane).
    The crash-on-close occurs whether I saved and waited or not, so does not seem to be related.

     
  • mikerofone
    mikerofone
    2011-05-10

    • priority: 5 --> 7