Bugs in 2.1.0

Is Virtual Radar Server not behaving itself? If so then please report it here.
YSWG
Posts: 18
Joined: Thu Oct 30, 2014 1:56 pm
Location: Wagga Wagga

Re: Bugs in 2.1.0

Post by YSWG » Wed Feb 04, 2015 1:12 am

Not sure why it would've ran our of memory when VRS is the only program running. Yes, the error messages were repeated so many times that any other messages were lost.

http://www.crowingstudios.com/vrslog/Vi ... darLog.txt

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.1.0

Post by agw » Thu Feb 05, 2015 12:39 am

It's most likely VRS that ate all the memory. If it happens again then start the task manager (Ctrl + Shift + Esc from anywhere in Windows,) and see how much memory VRS is consuming in the Processes tab before you kill it off. I'm wondering whether it's related to the BaseStation.sqb locking problem, if the database is locked then there might be some buffer somewhere filling up with items waiting to be written out to it. If you do see the database locked problem again then it'll be interesting to see if VRS's memory consumption at the time is excessive and ever-growing.

YSWG
Posts: 18
Joined: Thu Oct 30, 2014 1:56 pm
Location: Wagga Wagga

Re: Bugs in 2.1.0

Post by YSWG » Fri Feb 06, 2015 6:46 am

VRS has glitched out again. Got this before being flooded out with the other error (System.Drawing.BufferedGraphicsContext.)

Code: Select all

[2015-02-06 06:38:16.072 UTC] [t1] Not enough storage is available to process this command
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(String fileName)
   at VirtualRadar.WinForms.MainView.menuOpenVirtualRadarLogToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Code: Select all

[2015-02-06 06:40:04.572 UTC] [t1] Not enough storage is available to process this command
   at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
   at System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
   at System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   at System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   at System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.SplitContainer.WndProc(Message& msg)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Capture1.JPG
Capture1.JPG (94.71 KiB) Viewed 2642 times

eshabi
Posts: 2
Joined: Fri Feb 06, 2015 8:17 am

Windows handles abuse by VRS

Post by eshabi » Fri Feb 06, 2015 9:31 am

After only few days of running (three if I remember right) VRS had a count of 316K handles attached to its process.
Seems like a new handle is allocated every second.
I had problems running VRS for more than several days before the computer (a dedicated unattended Windows XP) stopped responding. Since no screen is attached to it and I did not manage to remote desktop it, I had to hardware restart it.
Few minutes ago I connected to this machine and found this handles abuse problem. I assume that eventually the OS will run out of handles and will stop responding.
Restarted VRS and it started to collect the handles again.
VRS.png
VRS.png (25.12 KiB) Viewed 2641 times

franzke
Posts: 2
Joined: Wed Feb 11, 2015 10:35 pm

Re: Bugs in 2.1.0

Post by franzke » Wed Feb 11, 2015 10:44 pm

Not sure if this a bug of just a coincidence...
Yesterday i saw a flight that landed about 10-15 km away and first i saw a height of 000, then GND or something like that which meant landed i think. a bit after that it went to 3000+ feet, exactly the same height as the other plane of the same company that was in the air. then it disappeared because it was out of sight or maybe disabled the transponder. It's difficult to reproduce because normally no flight lands there (ANR) with a ADS-B transponder ;-)

YSWG
Posts: 18
Joined: Thu Oct 30, 2014 1:56 pm
Location: Wagga Wagga

Re: Bugs in 2.1.0

Post by YSWG » Fri Feb 13, 2015 7:29 am

Just started to notice a lag (http://localhost/VirtualRadar/ slow loading) with VRS.
Capture5.JPG
Capture5.JPG (145.27 KiB) Viewed 2605 times
Capture6.JPG
Capture6.JPG (204.07 KiB) Viewed 2605 times
Well it did again, the same error as before.

Code: Select all

[2015-02-13 04:50:07.667 UTC] [t1] A generic error occurred in GDI+.
   at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
   at System.Drawing.Image.Save(Stream stream, ImageFormat format)
   at VirtualRadar.WebServer.Responder.SendImage(IRequest request, IResponse response, Image image, ImageFormat format)
   at VirtualRadar.WebSite.ImagePage.DoHandleRequest(IWebServer server, RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.Page.HandleRequest(Object sender, RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.WebSite.RequestContent(RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.WebSite.Server_RequestReceived(Object sender, RequestReceivedEventArgs args)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at VirtualRadar.WebServer.WebServer.OnRequestReceived(RequestReceivedEventArgs args)
   at VirtualRadar.WebServer.WebServer.GetContextHandler(IAsyncResult asyncResult)]

YSWG
Posts: 18
Joined: Thu Oct 30, 2014 1:56 pm
Location: Wagga Wagga

Re: Bugs in 2.1.0

Post by YSWG » Fri Feb 13, 2015 8:59 am

Code: Select all

[2015-02-13 08:57:30.377 UTC] [t1] Not enough storage is available to process this command
   at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
   at System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
   at System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   at System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   at System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.SplitContainer.WndProc(Message& msg)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

[2015-02-13 08:57:34.635 UTC] [t8] Exception thrown on background thread
   at VirtualRadar.WinForms.MainView.BubbleExceptionToGui(Exception ex)
   at VirtualRadar.Program.BackgroundThread_ExceptionCaught(Object sender, EventArgs`1 args)
   at VirtualRadar.WebServer.WebServer.OnExceptionCaught(EventArgs`1 args)
   at VirtualRadar.WebServer.WebServer.GetContextHandler(IAsyncResult asyncResult)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
-- INNER EXCEPTION --
Exception {System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.} caught during request for {/virtualradar/images/Wdth-68/Hght-131/Rotate-80/Alt-55/CenX-34/PL1-9V-SYK/PL2-SIA211/PL3-8146/Airplane.png} - see inner exception for details
No stack trace
-- INNER EXCEPTION --
A generic error occurred in GDI+.
   at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
   at System.Drawing.Image.Save(Stream stream, ImageFormat format)
   at VirtualRadar.WebServer.Responder.SendImage(IRequest request, IResponse response, Image image, ImageFormat format)
   at VirtualRadar.WebSite.ImagePage.DoHandleRequest(IWebServer server, RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.Page.HandleRequest(Object sender, RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.WebSite.RequestContent(RequestReceivedEventArgs args)
   at VirtualRadar.WebSite.WebSite.Server_RequestReceived(Object sender, RequestReceivedEventArgs args)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at VirtualRadar.WebServer.WebServer.OnRequestReceived(RequestReceivedEventArgs args)
   at VirtualRadar.WebServer.WebServer.GetContextHandler(IAsyncResult asyncResult)

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Windows handles abuse by VRS

Post by agw » Sat Feb 14, 2015 3:45 pm

eshabi wrote:After only few days of running (three if I remember right) VRS had a count of 316K handles attached to its process.
Seems like a new handle is allocated every second.
I had problems running VRS for more than several days before the computer (a dedicated unattended Windows XP) stopped responding. Since no screen is attached to it and I did not manage to remote desktop it, I had to hardware restart it.
Few minutes ago I connected to this machine and found this handles abuse problem. I assume that eventually the OS will run out of handles and will stop responding.
Restarted VRS and it started to collect the handles again.
Yes, something there isn't releasing handles. Eventually it will crash, handles are a finite resource.

I have an instance of VRS that's been running here since December 30th of last year which is currently holding about 700 handles, so I don't think it's something that is routinely failing to release handles. It would be useful to have a dump of the process if I'm to get to the bottom of this. If you're happy to do that (it will involve uploading a huge file) then the steps to follow are:

1. Download and run Process Explorer from SysInternals (https://technet.microsoft.com/en-gb/sys ... 96653.aspx)
2. Start Virtual Radar Server and wait until its holding on to say 2,000 handles
3. Right-click VirtualRadar.exe in Process Explorer and choose Create Dump | Create Full Dump
4. The .DMP file that it's created will be very large. You might want to compress it to ease the pain of uploading it.
5. Upload the dump file to one of the file sharing sites (DropBox, OneDrive, Google Drive etc.) and PM or email me the URL for it.

I'll then download the dump and take a look to see if I can figure out what's going on.

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.1.0

Post by agw » Sat Feb 14, 2015 4:01 pm

franzke wrote:Not sure if this a bug of just a coincidence...
Yesterday i saw a flight that landed about 10-15 km away and first i saw a height of 000, then GND or something like that which meant landed i think. a bit after that it went to 3000+ feet, exactly the same height as the other plane of the same company that was in the air. then it disappeared because it was out of sight or maybe disabled the transponder. It's difficult to reproduce because normally no flight lands there (ANR) with a ADS-B transponder ;-)
I've also seen the same thing occasionally with aircraft landing at Heathrow. They'll land just fine and then a few minutes later I get one message that shows them at 20,000 feet, and then nothing. I managed to capture one instance on a recording of an SBS-3 - I was recording both port 30003 and port 30006 from BaseStation, an aircraft landed at Heathrow and then a couple of minutes later a message came out of port 30006 that showed it at 34,000' but there was no corresponding message on port 30003. I presumed that BaseStation's sanity checker had recognised that the aircraft could not have moved from 0' to 30,000' in a couple of minutes and dropped the message, but allowed it through on port 30006 because it passed the parity check.

VRS does have a sanity checker for things like that, but it's not very good when more than about 30 seconds have elapsed between messages. I think basically I need to write a better sanity checker.

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.1.0

Post by agw » Sat Feb 14, 2015 4:05 pm

YSWG wrote:Just started to notice a lag (http://localhost/VirtualRadar/ slow loading) with VRS.
Capture5.JPG
Capture6.JPG
It's interesting that you're also seeing a large number of allocated handles, as per eshabi's post. If you could also produce a full dump when you hit a few thousand handles and send it to me as per the instructions above (http://forum.virtualradarserver.co.uk/p ... 361#pr3365) then that would be useful, I'll take a look and see if I can track down where the handles are leaking. Given that you're having all these problems in producing images I wouldn't be surprised if it was somewhere in there, although I can't think offhand of anything that's changed in that area for 2.1.

Locked