Bug 60318 - OracleConnection - paused reader problem
Summary: OracleConnection - paused reader problem
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data ()
Version: 5.2 (2017-04)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-23 12:37 UTC by JOP
Modified: 2017-10-27 12:16 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Logged stack trace at the moment of SIGSEGV (42.25 KB, text/plain)
2017-10-23 12:37 UTC, JOP
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description JOP 2017-10-23 12:37:35 UTC
Created attachment 25398 [details]
Logged stack trace at the moment of SIGSEGV

While using mono 5.2 and System.Data.OracleClient.OracleConnection I came across the bug, that causes whole application end due to SIGSEGV. Callstack can be found in attachement.

I read data from reader until I reach certain treshold, then I ask the user through GUI if he wants to continue. If not, I close the reader and move on. If he wants to continue, I continue to Read from reader.

			using (OracleConnection dbcon = new OracleConnection(connectionString))
			{
				dbcon.Open();

				using (OracleCommand dbcmd = dbcon.CreateCommand())
				{
					dbcmd.CommandText = @"select * from TABLE_WITH_CLOB";
					using (OracleDataReader reader = dbcmd.ExecuteReader(System.Data.CommandBehavior.SingleResult))
					{
						int counter = 0;
						while (reader.Read())
						{
							counter++;

							//process row data

							if (counter % 1000 == 0)
							{
                                                           //System.Threading.Thread.Sleep(1000);
                                                           if (App.ShowDialog("Do you want to continue?", "Question", MessageBoxButtons.YesNo) == DialogResult.Yes)
									break;
							}
						}
					}
				}
			}

This aproach works quite well, but when comes to queries to tables, that contains CLOB column, application usually (connection is unstable in this) crashes. Table I use has hundred of thousands rows with CLOB data usually less than 200 characters long. It does not matter whether I call ReadValues or not, nor whether I use main application connection or create new one, just for this task. 

The main culprit is the fact that I pause the reader. If I would read 10000 rows without asking, there would be no problem at all. But if I pause after 1000 rows, it crashes when next reader.Read() occures.

I cant present better example, that emulates this bug 100% of times after single pause, because connection/application crashes sometimes after one try, sometimes it takes several pauses, sometimes after first pause of next reader.
Comment 1 Marek Safar 2017-10-27 12:16:07 UTC
System.Data.OracleClient has been deprecated, see https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/oracle-and-adonet.