Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch 1.33b crashes when test method contains neverending recursion
trelak
#1 Posted : Wednesday, September 7, 2011 6:11:51 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/7/2011(UTC)
Posts: 1
Location: Wrocław

Hi,

Great tool! With a little minor issue that surely will be corrected in the final release:

NCrunch 1.33b crashes when test method contains neverending recursion

e.g.

[TestMethod]
public void HelloTest()
{
...
HelloTest();
...
}

Kind Regards
Wojtek
Remco
#2 Posted : Wednesday, September 7, 2011 7:01:18 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,967

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Wojtek,

Thanks for posting!

Yes - stack overflows are tough to deal with. I have a plan that should allow NCrunch to tackle this tidily, though it will take a bit of work and fortunately these issues are relatively rare in a developer's workday (unless your writing some manically recursive code). You'll notice that when these happen, the engine should just throw up and error and then carry on as usual.


Cheers,

Remco
alexnorcliffe
#3 Posted : Sunday, September 11, 2011 12:19:28 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/2/2011(UTC)
Posts: 23

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Oops looks like I might have posted a duplicate http://forum.ncrunch.net...es-NCrunch-to-fail.aspx
However, for me NCrunch didn't carry on as usual :)
It would even be a good iterative improvement if the NCrunch engine gracefully handled an exception from one of the runners, if the process exits due to a StackOverflowException it could make a few assumptions (since catching a StackOverflowException within the same process is a slightly recursive idea in itself...)
Remco
#4 Posted : Sunday, September 11, 2011 8:50:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,967

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
You're right in that dealing with stack overflows isn't simple. A stack overflow will rip through any exception trap and will religiously take down the process executing the offending code. The key issue is that when the process runs out of stack, it often works its way into an invalid state. The CLR does have some reliability features to allow proper cleanup after a stack overflow as occurred, but these are limited to damage control and reviving the process is extremely difficult to do. I do have some plans on handling them more gracefully in NCrunch - through it will likely involve letting the process die a natural death and simply trying to improve the user experience and pipeline management around this. Stay tuned :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.046 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download