[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-list
Subject:    Re: [Mono-list] Null task exception when doing ContinueWith
From:       Giuliano Barberi <gbarberi () aotaonline ! com>
Date:       2014-05-02 15:03:14
Message-ID: CALwbK7QP02QnVc1dZB26jh2fVBoV2y5u2nO1JjyYMpYp=_0EPg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I'm gonna try to isolate the issue but I haven't been able to reproduce it
in dev and only seen it in prod. Problem is without the stacktrace it's
hard to know where the problem is coming from. I'm wondering if anyone has
seen something similar or knows any case where the exception may be null.
If not, I'm gonna keep trying to reproduce it.


On Fri, May 2, 2014 at 9:24 AM, Rodrigo Kumpera <kumpera@gmail.com> wrote:

> Can you provide with a test case that shows this behavior? If so, please
> file a bug report.
>
>
> On Fri, May 2, 2014 at 7:17 AM, Giuliano Barberi <gbarberi@aotaonline.com>wrote:
>
>> Hey guys I'm seeing something strange. It could totally be user error but
>> I can't seem to figure it out.
>>
>> I am doing this on some tasks that I never await in order to get the
>> exception:
>>         public static Task CatchUnhandledException(this Task task)
>>         {
>>             return task.ContinueWith(continuation =>
>>
>> Engine.UnhandledExceptionHandler(continuation.Exception),
>>
>> TaskContinuationOptions.ExecuteSynchronously |
>> TaskContinuationOptions.OnlyOnFaulted);
>>         }
>>
>> and the Engine.UnhandledExceptionHandler just logs the exception.
>>
>> What's strange is that the exception is null and also doing
>> an Environment.StackTrace in the handler also yields nothing. I do have
>> --debug with the mdb files so I would suspect to get the full stacktrace. I
>> never saw this issue when I was running on .NET runtime but I also have
>> added more async code since so I'm not sure if it's something with Mono or
>> my app. I just can't find anything online and the documentation for Tasks
>> says that if it's faulted state there will be an exception.
>>
>> Regards
>> --
>> Giuliano Barberi
>>
>> _______________________________________________
>> Mono-list maillist  -  Mono-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>
>


-- 
Giuliano Barberi

[Attachment #5 (text/html)]

<div dir="ltr">I&#39;m gonna try to isolate the issue but I haven&#39;t been able to \
reproduce it in dev and only seen it in prod. Problem is without the stacktrace \
it&#39;s hard to know where the problem is coming from. I&#39;m wondering if anyone \
has seen something similar or knows any case where the exception may be null. If not, \
I&#39;m gonna keep trying to reproduce it.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 9:24 \
AM, Rodrigo Kumpera <span dir="ltr">&lt;<a href="mailto:kumpera@gmail.com" \
target="_blank">kumpera@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div dir="ltr">Can you provide with a test case that shows \
this behavior? If so, please file a bug report.</div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 7:17 AM, \
Giuliano Barberi <span dir="ltr">&lt;<a href="mailto:gbarberi@aotaonline.com" \
target="_blank">gbarberi@aotaonline.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hey guys I&#39;m seeing something strange. It \
could totally be user error but I can&#39;t seem to figure it out.<div>


<br></div><div>I am doing this on some tasks that I never await in order to get the \
exception:</div>

<div><div>            public static Task CatchUnhandledException(this Task \
task)</div><div>            {</div><div>                  return \
task.ContinueWith(continuation =&gt;</div><div>                                       \
Engine.UnhandledExceptionHandler(continuation.Exception),</div>




<div>                                             \
TaskContinuationOptions.ExecuteSynchronously | \
TaskContinuationOptions.OnlyOnFaulted);</div><div>            \
}</div><div><br></div><div>and the Engine.UnhandledExceptionHandler just logs the \
exception.</div>




<div><br></div><div>What&#39;s strange is that the exception is null and also doing \
an  Environment.StackTrace in the handler also yields nothing. I do have --debug with \
the mdb files so I would suspect to get the full stacktrace. I never saw this issue \
when I was running on .NET runtime but I also have added more async code since so \
I&#39;m not sure if it&#39;s something with Mono or my app. I just can&#39;t find \
anything online and the documentation for Tasks says that if it&#39;s faulted state \
there will be an exception.</div>




<div><br></div><div>Regards</div><span class="HOEnZb"><font \
color="#888888"><span><font color="#888888">-- <br>Giuliano Barberi \
</font></span></font></span></div></div><span class="HOEnZb"><font color="#888888"> \
<br>_______________________________________________<br> Mono-list maillist   -   <a \
href="mailto:Mono-list@lists.ximian.com" \
target="_blank">Mono-list@lists.ximian.com</a><br> <a \
href="http://lists.ximian.com/mailman/listinfo/mono-list" \
target="_blank">http://lists.ximian.com/mailman/listinfo/mono-list</a><br> \
<br></font></span></blockquote></div><br></div> </blockquote></div><br><br \
clear="all"><div><br></div>-- <br>Giuliano Barberi </div>



_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic