We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

''race condition'' exception in paint method

Hi,
We use Syncfusion grids, in virtual mode, extensively in our application.
We noticed the following exception from one of our users. We haven't managed to recreate this issue in a development envirnoment, but this is happening inside the syncfusion grid's paint method, so I wanted to know if you have any idea about what may have caused this?

thanks and regards,
Bijesh
2008-09-22 17:14:49,668 ERROR [5492] (ExceptionManager:0) - Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at Syncfusion.Diagnostics.TraceUtil.TraceExceptionCatched(Exception e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WmPaint(Message& msg)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.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)



7 Replies

JJ Jisha Joy Syncfusion Team September 26, 2008 06:37 AM UTC

Hi Bijesh,

Thank you for posting query to us.

The issue is not seems to be with Syncfusion Controls. Please refer the following MSDN forums that disscusses the similar issue:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3122353&SiteID=1

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/79eecc21-34b3-4c2a-9a88-bd62ea5d9782/

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/d652d4f9-69c9-48f2-a48b-d340a4909667/

Regards,
Jisha



DJ Daniel Jebaraj Syncfusion Team October 1, 2008 04:16 AM UTC

Hi Bijesh,

Is it possible that the grid is being updated from multiple threads? Please let us know.

Best regards,
Daniel
Syncfusion, Inc

>Hi,
We use Syncfusion grids, in virtual mode, extensively in our application.
We noticed the following exception from one of our users. We haven't managed to recreate this issue in a development envirnoment, but this is happening inside the syncfusion grid's paint method, so I wanted to know if you have any idea about what may have caused this?

thanks and regards,
Bijesh
2008-09-22 17:14:49,668 ERROR [5492] (ExceptionManager:0) - Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at Syncfusion.Diagnostics.TraceUtil.TraceExceptionCatched(Exception e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WmPaint(Message& msg)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.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)






BR Bijeshnath Ravindranath October 2, 2008 10:46 AM UTC

Hi Daniel and Jisha,
We have taken care about not accessing the gird from any thread other than the main app thread. So I do not think that is the issue.
In any case, we were unable to recreate this in our dev environment and so far it has not happened again in release env. So I don't really have anything else to go by. Thanks for the help, I will get back to you if it happens again, and if I can manage to get more information.
regards
Bijesh

>Hi Bijesh,

Is it possible that the grid is being updated from multiple threads? Please let us know.

Best regards,
Daniel
Syncfusion, Inc

>Hi,
We use Syncfusion grids, in virtual mode, extensively in our application.
We noticed the following exception from one of our users. We haven't managed to recreate this issue in a development envirnoment, but this is happening inside the syncfusion grid's paint method, so I wanted to know if you have any idea about what may have caused this?

thanks and regards,
Bijesh
2008-09-22 17:14:49,668 ERROR [5492] (ExceptionManager:0) - Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at Syncfusion.Diagnostics.TraceUtil.TraceExceptionCatched(Exception e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WmPaint(Message& msg)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.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)








JJ Jisha Joy Syncfusion Team October 3, 2008 10:18 AM UTC

Hi Bijesh,

Thank you for your update.

Regards,
Jisha



BR Bijeshnath Ravindranath February 3, 2009 09:31 AM UTC

Hi, We got this exception again in our app,. This time it happened inside a clippoard copy method call. The stack trace is below.

Please let me know if you have any information about this..


Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader. (An email has been sent to the support team): System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at Syncfusion.Diagnostics.TraceUtil.TraceExceptionCatched(Exception e)
at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.CopyCellsToClipboard(GridRangeInfoList rangeList, Boolean bLoadBaseStyles)
at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.CopyRange(GridRangeInfoList rangeList)
at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.Copy()


>Hi Bijesh,

Thank you for your update.

Regards,
Jisha





LW louise whitehurst October 23, 2019 09:24 AM UTC

Hi, looks like this tool hasn't encountered described exception inside a clippoard copy method call any more so issue can be closed.




AR Arulpriya Ramalingam Syncfusion Team October 24, 2019 06:30 AM UTC

Hi Louise, 
 
Thanks for the update. We are glad that the reported use case is resolved with the solution and please get back to us, if you need any further assistance. 
 
Arulpriya 


Loader.
Up arrow icon