Skip to content

R crashes when resizing windows (PR#2992)

7 messages · Gavin Simpson, Duncan Murdoch, Uwe Ligges +1 more

#
I tried R-1.7.0 Patched too and the problem hasn't changed.

I tried to replicate the bug on a colleague's machine and it behaved 
differently: In this case the window would freeze for a few seconds at a 
time while being resized. The cursor then also froze, requiring use of 
CtrlAltDel and Task Manager to kill the process. However, R didn't crash 
and exit by itself.

It's maybe worth pointing out that the problem can be removed (at least in 
Win2000) by going to Control Panel > Display Properties > Effects and 
deselecting "Show window contents while dragging".

Gavin
* *
Dr Gavin D. Alexander
Department of Statistics
Mathematics Building
University Gardens
University of Glasgow
GLASGOW G12 8QW
SCOTLAND

Tel:   0141-330-4852
email: gavin@stats.gla.ac.uk
#
I've now committed changes to R-patched which appear to fix this
crash, at least on my system.

The problem was as follows:

During resizing, R allocates multiple bitmaps, then deletes them all
at the end.  If resources are tight (or if you do a lot of resizing),
you can run out of something (not sure what) and then the bitmap
allocation will fail.  This is supposed to give you an error message,
but it was leading to a crash.

To make the problem worse, intermediate allocations weren't always
being freed.

I've fixed both problems now, and am uploading a binary Windows build
to <http://www.stats.uwo.ca/faculty/murdoch/software/r-devel>.  Please
download and install rw1070pat.exe (22,183,871 bytes) and see if you
can get it to crash or act badly now.

I'm heading out of town for a few days, so I'm not likely to respond
to reports immediately, but I'll do so as soon as I can.

Duncan Murdoch
#
Duncan Murdoch wrote:
I cannot (re)produce a crash anymore, instead the message "Insufficient 
memory. Please close the console." appears.
Is there any reason for closing the console?

Uwe
#
On Wed, 14 May 2003, Uwe Ligges wrote:

            
Probably.  That means that one of the internal structures has not be
allocated, and carrying on would lead to a crash (or at least, that is
what it meant before Duncan's recent changes).
#
At 22:23 13/05/2003, Duncan Murdoch wrote:
Like Uwe, I also get the same message: "Insufficient memory. Please close 
the console." Click the OK button and the console window remains, but 
blank. Start to resize it again and all the text content reappears and R 
seems to be working normally again. This is the same for pager windows and 
in both MDI and SDI mode.

So it doesn't crash now, which is great!

Gavin


* *
Dr Gavin D. Alexander
Department of Statistics
Mathematics Building
University Gardens
University of Glasgow
GLASGOW G12 8QW
SCOTLAND

Tel:   0141-330-4852
email: gavin@stats.gla.ac.uk
#
On Wed, 14 May 2003 09:26:04 +0200, you wrote:

            
Does this happen in normal use, or only if you push things by resizing
continuously for a while?  I can get it to happen, but only by
resizing the window continuously for a minute or two. It's what I
consider to be a design flaw in Graphapp that it does a lot of
allocations during resizing, but doesn't do the deallocations
immediately  --  it just adds items to a list to be deleted at a later
time.  If you push too hard, it runs out of some resource (I think
it's device contexts) before it has done the deallocations, and you
get that message.

It's actually safe to proceed, but you need to find some way to
trigger a redraw *after* the resources have been recovered, or you
won't see anything in the console.  The simplest way to do this is to
resize the window once more.  Perhaps I should change the error
message, but if this only happens when you torture R, I don't think
it's a priority.

I think a better long term solution is to move away from Graphapp.

Duncan Murdoch
#
On Wed, 14 May 2003 12:23:34 +0100, you wrote:

            
That's good news.  I've found a slightly better patch that seems  to
remove that error too, but I won't be able to upload a binary build
that incorporates it for a few days.  I'm not sure if I can even get a
connection to commit the patch to the source tree.

The new patch releases the resources after each resize attempt, rather
than waiting until the end, so you aren't likely to run out no matter
how much you try.

Duncan Murdoch