Graphical glitches in IDE-Unable to allocate device context

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Graphical glitches in IDE-Unable to allocate device context

Postby jduff » Wed Jan 02, 2008 11:55 am

Hi,

My development team is using VA Smalltalk 7.5.1. Sometimes the IDE window graphics start acting up and makes it necessary to restart the dev environment.

So I'm looking for advice where to look for the source of this problem.

I've posted a couple of examples:

debugger1

debugger2

This started when we upgraded to VA Smalltalk 7.5.0 (and subsequently 7.5.1). We used VisualAge Smalltalk 6.x and 5.x without experiencing these problems.

Even though both of these examples are in the debugger, it is not exclusively debugger. I've seen these problems myself when using the Changes Browser and I hadn't used the debugger at all.

It does seem to be activity driven. By that I mean it doesn't start right away--it seems to happen based upon opening and closing a lot of windows or using the debugger a lot. After maybe an hour of regular use it starts doing this.

I've checked Task Manager memory levels and they look reasonable. I can post specific numbers if there is a particular need.

These are Windows XP machines with 2 GB of RAM.

We've tried "Clean up Image" from the Organizer without any effect.

We've tried using the debugger without the code coloring and that didn't seem to stop the problem.

I've successsfuly reproduced the error by simply starting abt.exe and opening and closing an editor several dozen times and finally reproduced the "Unable to allocate device context" error (see below). The memory used by abt.exe (as shown in Windows Task Manager) remained constant @ about 61MB and total page file memory used didn't change either.

=================================

Debugger Stack Trace Report:
Error String: 'Unable to allocate device context.'
Resumable: false

UIProcess
Name: (1/2/2008 12:17:10 PM)
Process State: suspended
Priority: 7

Executing in: CgPixmap(CgDrawable)>>#errorBadDC

System Configuration Dump


Copyright:

VA Smalltalk V7.5 ; Image: 7.5
VM Timestamp: 4.0,(NC) 1/22/2007 (72)
(C) Copyright Instantiations 1994, 2007. All rights reserved.
(C) Copyright International Business Machines Corp. 1994, 2006. All rights reserved.

Time: 12:17:45 PM
Date: 1/2/2008

Platform:

Virtual machine: ES
Bytecode version: 4.0
Manager version: 4.00
'OS' subsystem: 'WIN32s'
'CLIM' subsystem: 'ES'
'CP' subsystem: 'WIN32s'
'CLDT' subsystem: 'ES'
'CFS' subsystem: 'WIN32s'
'SCI' subsystem: 'WIN'
'CW' subsystem: 'WIN32s'
'CPM' subsystem: 'ES'
'CG' subsystem: 'WIN32s'
'CPIC' subsystem: 'WIN32s'

Current user: John Duff

Connected Library:

Pathname: chq-emsrv-nt :: D:\vast70\manager\mgr70.dat
Library version: 6
Size of library: 839387520 bytes
Has consistent EOF: true
Acquire read locks: false
Single user mode: false
Server address: 'chq-emsrv-nt'

Library Access:

Host system name: None
Use release lock mode: true
Native primitives library: emntv50
Emsrv primitives library: emsrv50

Memory:

Total allocation: 54019084 bytes
Available: 5438348 bytes
Fixed Space: 36540 bytes
New Space: 123212 bytes
Old Space: 5314524 bytes

=============<STACK TRACE BEGINS>============
[] in <optimized block>(ExceptionalEvent class)>>#initializeSystemExceptions
signal=Signal on Exception: (ExError) An error has occurred.
Signal>>#evaluate:
self=Signal on Exception: (ExError) An error has occurred.
aBlock=[] in ExceptionalEvent class>>#initializeSystemExceptions
ExceptionalEvent>>#applyDefaultHandler:
self=Exception: (ExError) An error has occurred.
aSignal=Signal on Exception: (ExError) An error has occurred.
exception=Exception: (ExError) An error has occurred.
ExceptionalEvent>>#signalWithArguments:
self=Exception: (ExError) An error has occurred.
arguments=('Unable to allocate device context.')
signal=Signal on Exception: (ExError) An error has occurred.
handler=nil
ExceptionalEvent>>#signalWith:
self=Exception: (ExError) An error has occurred.
arg1='Unable to allocate device context.'
CgPixmap(Object)>>#error:
self=a CgPixmap
aString='Unable to allocate device context.'
CgPixmap(CgDrawable)>>#errorBadDC
self=a CgPixmap
CgPixmap>>#getDC
self=a CgPixmap
hDC=OSHdc {0}
CgPixmap(CgDrawable)>>#deviceContextDo:
self=a CgPixmap
aBlock=[] in CgGC>>#copyArea:srcX:srcY:width:height:destX:destY:
hDC=nil
CgGC>>#copyArea:srcX:srcY:width:height:destX:destY:
self=a CgGC
src=a CgPixmap
srcX=0
srcY=0
width=9
height=9
destX=2
destY=5
w=9
h=9
CgPixmap(CgDrawable)>>#copyArea:gc:srcX:srcY:width:height:destX:destY:
self=a CgPixmap
dest=a CgWindow
gc=a CgGC
srcX=0
srcY=0
width=9
height=9
destX=2
destY=5
CgPixmap>>#ewDrawUsing:
self=a CgPixmap
anEwRenderContext=an EwRenderContext
EwIconHierarchyPolicy>>#drawIcon:using:
self=an EwIconHierarchyPolicy
anIcon=a CgPixmap
anRC=an EwRenderContext
wIcon=9
hIcon=9
xOld=0
yOld=0
wOld=13
hOld=18
EwIconHierarchyPolicy>>#drawIconUsing:node:
self=an EwIconHierarchyPolicy
anRC=an EwRenderContext
aTreeNode=an EwTableTreeNode
icon=a CgPixmap
EwIconHierarchyPolicy>>#drawUsing:node:
self=an EwIconHierarchyPolicy
anRC=an EwRenderContext
aTreeNode=an EwTableTreeNode
EwIconHierarchyPolicy(EwHierarchyPolicy)>>#drawUsing:in:node:
self=an EwIconHierarchyPolicy
anRC=an EwRenderContext
aRect=0 @ 0 corner: 190 @ 105
aTreeNode=an EwTableTreeNode
wOld=13
EwTableTreeNode>>#partialDrawUsing:in:
self=an EwTableTreeNode
anRC=an EwRenderContext
aRect=0 @ 0 corner: 190 @ 105
StsHierarchyList(EwTableList)>>#partialDrawItemAt:x:y:width:height:damagedRectangle:
self=a StsHierarchyList
index=1
x=0
y=0
width=258
height=18
damagedRectangle=0 @ 0 corner: 190 @ 105
node=an EwTableTreeNode
realSelectedState=false
StsHierarchyList(EwTableList)>>#partialDrawRangeFrom:to:y:damagedRectangle:
self=a StsHierarchyList
firstItem=1
lastItem=1
yStart=0
damagedRectangle=0 @ 0 corner: 190 @ 105
y=0
itemHeight=18
yLimit=105
x=0
width=258
visibleIndex=1
node=an EwTableTreeNode
index=1
StsHierarchyList(EwTableList)>>#drawRangeFrom:to:y:damagedRectangle:
self=a StsHierarchyList
firstItem=1
lastItem=1
yStart=0
damagedRectangle=0 @ 0 corner: 190 @ 105
y=0
yLimit=nil
x=nil
width=nil
renderContext=nil
offset=nil
StsHierarchyList(EwLinearList)>>#exposeRectangle:
self=a StsHierarchyList
aRectangle=0 @ 0 corner: 190 @ 105
start=1
StsHierarchyList(EwScrollable)>>#expose:clientData:callData:
self=a StsHierarchyList
widget=CwDrawingArea(classHierarchyRoots_DrawingArea)
clientData=nil
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
StsHierarchyList(EwList)>>#expose:clientData:callData:
self=a StsHierarchyList
widget=CwDrawingArea(classHierarchyRoots_DrawingArea)
clientData=nil
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
StsHierarchyList(EwLinearList)>>#expose:clientData:callData:
self=a StsHierarchyList
widget=CwDrawingArea(classHierarchyRoots_DrawingArea)
clientData=nil
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
StsHierarchyList(EwTableList)>>#expose:clientData:callData:
self=a StsHierarchyList
widget=CwDrawingArea(classHierarchyRoots_DrawingArea)
clientData=nil
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
CwCallbackRec>>#callWith:callData:
self=a CwCallbackRec
aWidget=CwDrawingArea(classHierarchyRoots_DrawingArea)
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
CwDrawingArea(CwBasicWidget)>>#callCallbackList:callData:
self=CwDrawingArea(classHierarchyRoots_DrawingArea)
aCallbackList=OrderedCollection(a CwCallbackRec )
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
callbacks=nil
size=1
rec1=nil
rec2=nil
rec3=nil
CwDrawingArea(CwComposite)>>#callExpose:
self=CwDrawingArea(classHierarchyRoots_DrawingArea)
anEvent=an OSExpose
exposeEvent=a CwExposeEvent
callData=CwDrawingCallbackData(
reason -> 38
window -> a CgWindow
event -> a CwExposeEvent
)
OSComposite(OSWidget)>>#callHandlers:with:
self=OSComposite()
handlers=#callExpose:
data=an OSExpose
OSComposite(OSWidget)>>#event:data:deferred:
self=OSComposite()
anEvent=10
data=an OSExpose
deferred=false
handlers=#callExpose:
OSComposite(OSWidget)>>#sendEvent:data:
self=OSComposite()
anEventType=10
data=an OSExpose
OSComposite(OSWidget)>>#exposeRect:
self=OSComposite()
aRect=0 @ 0 corner: 190 @ 105
data=an OSExpose
OSComposite(OSWidget)>>#exposeOSRect:
self=OSComposite()
aRect=*OSRect {
left: 0
top: 0
right: 190
bottom: 105
}
[] in OSComposite>>#wmPaint:with:
self=OSComposite()
rect=*OSRect {
left: 0
top: 0
right: 190
bottom: 105
}
OSComposite(OSWidget)>>#paintDo:
self=OSComposite()
aBlock=[] in OSComposite>>#wmPaint:with:
hDC=OSHdc {167842472}
oldDC=nil
struct=*OSPaintstruct {
hdc: OSHdc {822153839}
fErase: false
rcPaint: *OSRect {
left: 0
top: 0
right: 559
bottom: 18
}
fRestore: false
fIncUpdate: false
rgbReserved: OSUInt8 [32] {101 180 129 191 65 0 4 1 80 150 154 191 224 145 55 138 144 107 2 168 140 107 2 168 168 0 0 0 34 254 255 255}
}
rcPaint=*OSRect {
left: 0
top: 0
right: 190
bottom: 105
}
state=false
OSComposite>>#paintDo:
self=OSComposite()
aBlock=[] in OSComposite>>#wmPaint:with:
state=nil
oldStyle=nil
newStyle=nil
OSComposite>>#wmPaint:with:
self=OSComposite()
wParam=0
lParam=0
OSComposite(OSWidget)>>#windowProc:with:with:
self=OSComposite()
msg=15
arg1=0
arg2=0
selector=#wmPaint:with:
result=nil
OSEventManager class>>#windowProc:msg:with:with:
self=OSEventManager
hwnd=1251738
msg=15
arg1=0
arg2=0
object=OSComposite()
OSMsg>>#dispatchMessage
self=*OSMsg {
hwnd: OSHwnd {269020}
message: 273
wParam: 283
lParam: 0
time: 184817328
pt: *OSPoint {
x: 171
y: 47
}
}
OSEventManager class>>#dispatchEvent
self=OSEventManager
state=false
OSWidget class>>#readAndDispatch
self=OSWidget
state=true
gotEvent=true
CwAppContext>>#readAndDispatch
self=a CwAppContext
AbtWindowSystemStartUp class(EsWindowSystemStartUp class)>>#messageLoop
self=AbtWindowSystemStartUp
lastEventTime=184782531
appContext=a CwAppContext
[] in <optimized block>(UIProcess class)>>#forkUserInterface
[] in UIProcess(Process)>>#executeBlock:withArguments:
self=UIProcess:(1/2/2008 11:55:25 AM){dead,3}
aBlock=[] in UIProcess class>>#forkUserInterface
args=()
UIProcess(Process)>>#executeBlock:withArguments:
self=UIProcess:(1/2/2008 11:55:25 AM){dead,3}
aBlock=[] in UIProcess class>>#forkUserInterface
args=()
UIProcess(Process)>>#newProcessOn:stackSize:withArguments:named:
self=UIProcess:(1/2/2008 11:55:25 AM){dead,3}
aBlock=[] in UIProcess class>>#forkUserInterface
stackSize=1024
args=()
procName='(1/2/2008 11:55:25 AM)'
==============<STACK TRACE ENDS>=============
[/list]
jduff
 
Posts: 15
Joined: Wed Jan 02, 2008 8:59 am

Re: Graphical glitches in IDE-Unable to allocate device cont

Postby Eric Clayberg » Wed Jan 02, 2008 1:10 pm

Are you sure this is happening in 7.5.1?

There was a problem in 7.5.0 (which appears to be the version you are using) which was fixed in 7.5.1 (and 7.5.2). From the 7.5.1/2 readme.

Defects fixed in V7.5.1
...
27378 VASmalltalk 7.5 running out of GDI-Objects

I would suggest trying this again in a clean 7.5.2 image. I tried it and gave up after opening and closing >100 browser windows.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby wembley » Thu Jan 03, 2008 4:30 am

John -

As Eric said, this problem was reported on VA Smalltalk 7.5 and corrected in VA Smalltalk 7.5.1. I looked at the original problem report and the walkback is identical to yours.

The fix was in the StsPowerTools application, so be sure you are running with the latest version of VA Assist Pro for VisualAge loaded.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Postby jduff » Thu Jan 03, 2008 6:59 am

Thank you both. I will give it a try. I was sure we were using 7.5.1 but then I remembered that 7.5.1 was released about 2 days after we upgraded to 7.5.0 and we weren't ready to go through the process again. :) We're going to upgrade to 7.5.2. Thank you!
jduff
 
Posts: 15
Joined: Wed Jan 02, 2008 8:59 am

Postby crenz » Wed Jan 09, 2008 9:49 pm

If your problem persists, try Bear from http://run.to/sz. It shows the number of handles allocated per application and can help track resource leaks.
crenz
 
Posts: 10
Joined: Tue May 29, 2007 4:56 am
Location: Stuttgart, Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest