Bug 35726 - [tvos] Division by zero crashes app
Summary: [tvos] Division by zero crashes app
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: tvOS
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-11-10 05:30 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2015-11-16 22:33 UTC (History)
3 users (show)

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

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 Developer Community or GitHub 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 FIXED

Description Rolf Bjarne Kvinge [MSFT] 2015-11-10 05:30:56 UTC
Test case:

	try {
		int i = 0;
		Console.WriteLine (i / i);
	} catch (Exception e) {
		Console.WriteLine (e);
	}

Results in:

> 2015-11-10 11:28:43.173 SystemNumericsTests[69774:69354143] critical: Stacktrace:
> 
> 2015-11-10 11:28:43.173 SystemNumericsTests[69774:69354143] critical: 
> Native stacktrace:
> 
> 2015-11-10 11:28:43.189 SystemNumericsTests[69774:69354143] critical: 	0   SystemNumericsTests                 0x0000000106e483dd mono_handle_native_sigsegv + 253
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	1   SystemNumericsTests                 0x0000000106e5192f mono_sigfpe_signal_handler + 159
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	2   libsystem_platform.dylib            0x000000010dfe3f1a _sigtramp + 26
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	3   ???                                 0x0001206800000040 0x0 + 317106025398336
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	4   ???                                 0x000000011f04ff8b 0x0 + 4815388555
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	5   SystemNumericsTests                 0x0000000106e540f7 mono_jit_runtime_invoke + 1703
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	6   SystemNumericsTests                 0x0000000106ee8ffe mono_runtime_invoke + 110
> 2015-11-10 11:28:43.190 SystemNumericsTests[69774:69354143] critical: 	7   SystemNumericsTests                 0x0000000106eed70b mono_runtime_exec_main + 379
> 2015-11-10 11:28:43.191 SystemNumericsTests[69774:69354143] critical: 	8   SystemNumericsTests                 0x0000000106fabacf xamarin_main + 1983
> 2015-11-10 11:28:43.191 SystemNumericsTests[69774:69354143] critical: 	9   SystemNumericsTests                 0x0000000106d88b80 main + 80
> 2015-11-10 11:28:43.191 SystemNumericsTests[69774:69354143] critical: 	10  libdyld.dylib                       0x000000010dcba9e9 start + 1

Crash report: https://gist.github.com/rolfbjarne/3f83a0babfb2c9ab5284
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-11-10 05:31:50 UTC
This is in the TV simulator (I haven't tried on device).
Comment 2 Sebastien Pouliot 2015-11-12 09:26:14 UTC
System.Numerics unit tests fails on tv simulator [1] but they seems to works fine on devices [2]. Also, on device, the code above prints the expected:

> System.DivideByZeroException: Attempted to divide by zero.


[1] https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=1381&host_id=200&revision_id=650096#

Exception Type:        EXC_ARITHMETIC (SIGABRT)
Exception Codes:       EXC_I386_DIV (divide by zero)

^ crash report https://wrench.internalx.com/Wrench/GetFile.aspx?id=10683570


[2]
...
2015-11-12 09:17:00.836 SystemNumericsTests[311:176501] SystemNumericsTests.exe : 263 ms
2015-11-12 09:17:00.837 SystemNumericsTests[311:176501] Tests run: 58 Passed: 58 Inconclusive: 0 Failed: 0 Ignored: 0
Comment 3 Zoltan Varga 2015-11-13 22:44:31 UTC
The original problem is now fixed on the master-with-mono.4.3.1 branch.
Comment 4 Sebastien Pouliot 2015-11-16 16:02:36 UTC
@Zoltan what's the commit ? Rolf bumped maccore to use the newer 4.3.1 mono but that test still fails.
Comment 5 Zoltan Varga 2015-11-16 22:33:13 UTC
This should be fixed by the mono bump in maccore master 85542e04bb0c22f925f0dc2848e27ef01965b8c0.