[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texmacs-dev] Identified occasional crash in TeXmacs/Qt
From: |
Norbert Nemec |
Subject: |
[Texmacs-dev] Identified occasional crash in TeXmacs/Qt |
Date: |
Tue, 30 Jun 2009 10:07:31 +0100 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090608) |
Hi there,
once in a blue moon, TeXmacs/Qt happens to crash spontaneously. By
switching on core-dumps and debugging symbols in the program that I run
every day, I finally managed to capture one such event and identify the
problem:
In the routine
basic_renderer_rep::image_auto_gc()
(file: src/Graphics/Renderer/basic_renderer.cpp), there is a line
if (diff/fact > 60000) ...
where fact is larger than zero as long as ci->nr is positive.
I guess that the X11 gui takes care that ci->nr never becomes zero, so
the check is safe. In the Qt gui, however, that counter obviously can
drop to zero, causing a crash at the next garbage collection, which
seems to happen spontaneously to the user.
Simple fix:
if (diff > 60000*fact) ...
This does not solve the underlying problem (why does the counter drop to
zero without the image being deallocated right away?) but at least it
prevents a mystifying crash.
To be absolutely safe, fact should probably be declared float,
otherwise, a few thousand copies of an image (which is unlikely but not
completely unrealistic) might cause an int32 overflow.
Greetings,
Norbert
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Texmacs-dev] Identified occasional crash in TeXmacs/Qt,
Norbert Nemec <=