Bug 33916 - Incorrect working of UnixSignal when calling Console.Beep
Summary: Incorrect working of UnixSignal when calling Console.Beep
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: Mono.POSIX (show other bugs)
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-14 02:09 UTC by BogdanovKirill
Modified: 2015-09-14 02:09 UTC (History)
1 user (show)

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


Attachments

Description BogdanovKirill 2015-09-14 02:09:46 UTC
The problem is that UnixSignal doesn't work at all if program sometimes calls Console.Beep() command. Just check this example:

static void Main(string[] args)
{
			var signals = new[]
				{
					new UnixSignal(Signum.SIGINT),
					new UnixSignal(Signum.SIGABRT),
					new UnixSignal(Signum.SIGTERM),
					new UnixSignal(Signum.SIGUSR1),
				};

			while (true)
			{
				int index = UnixSignal.WaitAny(signals, 1000);

				if (index == 1000)
				{
					Console.Beep();
					continue;
				}

				Signum signal = signals[index].Signum;
				Console.WriteLine("Signal received " + signal);
				break;
			}
}

You could run that program in console, then press Ctrl + C combination and you will see nothing. Then just comment Console.Beep() line and run it again. After Ctrl + C you will see: "Signal received SIGINT".

Tested on Ubuntu 14.04.3 TLS. I checked mono 4.0.3 and mono 4.2.1 and didn't see any difference.

Note You need to log in before you can comment on or make changes to this bug.