Bug 414 - Segmentation fault instead of StackOveflow
Summary: Segmentation fault instead of StackOveflow
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Linux
: Normal major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-08-25 08:49 UTC by Marek Safar
Modified: 2013-09-08 19:01 UTC (History)
4 users (show)

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 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:

Description Marek Safar 2011-08-25 08:49:49 UTC
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;

class A : IAsyncResult
	#region IAsyncResult implementation
	public object AsyncState {
		get {
			throw new NotImplementedException ();

	public System.Threading.WaitHandle AsyncWaitHandle {
		get {
			throw new NotImplementedException ();

	public bool CompletedSynchronously {
		get {
			throw new NotImplementedException ();

	public bool IsCompleted {
		get {
			throw new NotImplementedException ();

class C
	public static void Main ()
		var f = new TaskFactory<int> ();
		f.FromAsync (new A (), null);

Compile & Run

Segmentation fault

Setting to major as I am working on TaskFactory and don't know how long it will be reproducible.
Comment 1 Zoltan Varga 2011-08-25 17:25:23 UTC
This is still the usual stack overflow, I get:

Stack overflow: IP: 0x410a2a84, fault addr: (nil)
  at System.Threading.Tasks.TaskFactory`1<int>.FromAsync (System.IAsyncResult,System.Func`2<System.IAsyncResult, int>,System.Threading.Tasks.TaskCreationOptions) <0x0001b>
  at System.Threading.Tasks.TaskFactory`1<int>.FromAsync (System.IAsyncResult,System.Func`2<System.IAsyncResult, int>) <0x0002b>
  at C.Main () <0x00047>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
Comment 2 Zoltan Varga 2011-09-05 15:00:40 UTC
Does the output of mono --version show:

        SIGSEGV:       altstack
Comment 3 Marek Safar 2011-09-05 15:06:01 UTC
yes, but as I said you need to run it again mono master from 2011-08-25

Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 4 Zoltan Varga 2011-09-05 16:14:07 UTC
If altstack is enabled, then you should be seeing Stack overflow messages, not hard crashes.
Comment 5 Rodrigo Kumpera 2013-09-08 19:01:38 UTC
This no longer stack overflow with 3.X.