"Range Check Error" - funky default printer

A "range check error" is one of the least useful messages in Evolution: it's technically correct (in that it describes a low-level problem), but is almost entirely un-actionable on its own. What caused it? Is it a bug? etc. Ugh.

But occasionally we can get some clues to a workaround from context, and a range check error while previewing a report is one of them.

But: we need to see the full error details to get that context. Let's look at one:

Range check error
date/time : 2015-01-13, 17:15:41, 573ms
computer name : STEVEPC
user name : steve
operating system : Windows NT New Service Pack 1 build 7601
system language : English
system up time : 3 days 12 hours
program up time : 400 milliseconds
processors : 16x Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
physical memory : 14354/32755 MB (free/total)
free disk space : (C:) 362.61 GB
display mode : 1600x900, 32 bit
process id : $4db4
allocated memory : 29.90 MB
command line : "C:\iSystems\Evolution\Client\isRWPreview.exe" /server
"C:\Users\steve\AppData\Local\Temp\26\ISystems\Evolution
\B9A523A302364555BA969112A3515819.tmp" /owner 7D031DD06A9540739A1DCE198955CC73
executable : isRWPreview.exe
exec. date/time : 2014-01-13 21:16
version : 12.9.0.7
madExcept version : 3.0b
callstack crc : $b9c6f1b7, $d8de6fd0, $d8de6fd0
exception number : 1
exception class : ERangeError
exception message : Range check error.

main thread ($aabc):
004067c2 isRWPreview.exe System DynArraySetLength
00406945 isRWPreview.exe System @DynArraySetLength
0065f7b0 isRWPreview.exe rwPrinters 829 +69 TrwPrinter.SetPrinter
0065ffe4 isRWPreview.exe rwPrinters 1070 +31 TrwPrinter.SetToDefaulTrwPrinter
0065fae0 isRWPreview.exe rwPrinters 933 +1 TrwPrinter.GetPrinterIndex
006c1616 isRWPreview.exe rwBasicPrint 52 +4 SetPrinterSettings
006d8d4e isRWPreview.exe rwOneRepPreviewFrm 1608 +12 TrwOneRepPreview.cbReportsChange
006d8c58 isRWPreview.exe rwOneRepPreviewFrm 1580 +19 TrwOneRepPreview.PreviewReport
006e191b isRWPreview.exe rwPreviewApp 394 +13 TrwPreviewApp.PreviewGroup
006e2e32 isRWPreview.exe rwPreviewComm 163 +1 MethodProc
006d4299 isRWPreview.exe rwConnectionInt 462 +4 TrwServerDatagramDispatcher.DoInMainThread
0050735b isRWPreview.exe isThreadManager TSyncInfo.Execute
00507247 isRWPreview.exe isThreadManager TSynchronizer.WndProc
00476c8c isRWPreview.exe Classes StdWndProc
76907bc5 USER32.dll DispatchMessageA
004dfb43 isRWPreview.exe Forms TApplication.ProcessMessage
004dfb7a isRWPreview.exe Forms TApplication.HandleMessage
004dfdaa isRWPreview.exe Forms TApplication.Run
006e51f8 isRWPreview.exe isRWPreview 62 +11 initialization
76643388 kernel32.dll BaseThreadInitThunk

What we see here:

  • This happened on Steve's PC, not a middle-tier server (which might be called EVO1); that tells us where we should be looking for things. One must almost always know which computer an error occurred on to do anything bout it.
  • The thing Evo was doing just before the range check error was something related to the default printer (the function SetToDefaulTrwPrinter). We don't have to have access to source code to get a hint what this is about.

I've found that this is often caused by having an unusual default printer, and changing the default printer to something else will work around this issue. This is the case even if you're only previewing, not printing.

Note: this is almost certainly a bug in Evolution, behaving poorly when it runs across a condition it didn't expect. The user hasn't done anything wrong, but repair of this issue hasn't been a priority: all you can do is work around it.