SheepAspect - cool project, unfortunately currently not usuable.

Mar 22, 2013 at 9:53 PM
I love the this project, and Sheep Oriented Programming in general.
But it breaks my build every time I change something.
It doesn't weave anytime I change something.

I've by now tried uninstall-reinstall the Sheep.
Deleted all binaries.
Closed IDE.
Rebuilt.
Not weaving.
If weaving - I get Engine runtime exceptions on the line of 'CLR bug'.

I use VS 2010.
Installed from NuGet.
I suspect some x86/x64 buggery here - I use x64 win 7, but project targeting x86 from Any CPU configuration.

I won't to hear about any experience poeple may have had with breaking builds, unfound dlls, Engine runtime exceptions, and so on. Maybe you can help me I wanted to use this project so much...
Mar 22, 2013 at 10:01 PM
Once I got the thing to weave, running in debug mode fro IDE.
This exception seems to be thrown on exiting the app.

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x56bb3020, on thread 0x1558. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Sounds familiar?
Mar 22, 2013 at 10:29 PM
Once I got the thing to weave, running in debug mode fro IDE.
This exception seems to be thrown on exiting the app.

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x56bb3020, on thread 0x1558. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Sounds familiar?
Mar 22, 2013 at 10:42 PM
I've traced down the exact point of failure: It's a call to
Func<ISomething, int> - a method that accepts an interface an returns int.

I'll replace this function handle with an interface, hope that solves the problem.
Mar 22, 2013 at 11:24 PM
I think I've ruled out x64/x86 mismatch as source of crash, as I've targeted all dependencies to x86 and still crush on entering the Func.
Let's see if replacing the Func does the trick...
Mar 22, 2013 at 11:50 PM
I think I've ruled out x64/x86 mismatch as source of crash, as I've targeted all dependencies to x86 and still crush on entering the Func.
Let's see if replacing the Func does the trick...
Mar 23, 2013 at 2:25 AM
I've tried to build a minimal Sheep app to demonstrate the crash, only it didn't crash. So calling a Fanc that accepts an interface, by itself, is not enough to reproduce the crash. I'm working with the sample Aspect BTW (just changed the returned value to object).
Coordinator
Mar 24, 2013 at 11:01 PM
Sorry for all the pain. Would you be able to send me some sample code? Im suspecting you may be touching specific areas that are not yet properly supported (such as weaving CLR events).
Cheers
Mar 27, 2013 at 6:47 AM
Dear Mr. Hendryluk,

Thanks for the kind words, I'm ready to suffer to some extent if the final result will be using your project!

I think I've found my bug and it has nothing to do with SheepAspect (I think).
The actual Exception was thrown on invoking public method with out parameter.
I was trying to log jp.Args from my Aspect, and for some reason - an out parameter throws a NullReferenceException on ToString() - even when it's clearly not null.
Another bug I had is not to exclude ToString() from the Aspect selection - I think that what made the exception a total CLR crash.

Currently, just by adding & !Name: 'ToString' to the attribute, and try-catching around String.Join(",", jp.Args) - my problems are solved :-)

Sorry for the harsh words with which I've opened this thread... That's just frustration speaking.

Thanks and keep on the great job!
Coordinator
Mar 27, 2013 at 7:18 AM
Hi Avinamal.
Thanks for the efforts and the support. Feedbacks and bug reports from early adopters are very helpful for the project to gain maturity it desperately needs, so keep them coming :)
One potential issue I can see from your initial implementation (which may or may not be related to the issue you were having) is a possibility of StackOverflowException, i.e. if your class overrides the ToString() method, when your logging aspect make a ToString() invocation, it may trigger a further (undesired) logging.
Regarding the out (or ref) parameter, frankly it's one of the CLR features I have not really tested nor supported. I will definitely have a look into it, and add it to the bug-list if it's found to be broken (which i strongly suspect it is).
But in the meantime if you're having another issue or difficulty, please do give me a shout.
Mar 28, 2013 at 12:46 AM
Just one last question as it's not completely clear from the site - Is the source downloadable from here the latest version? i.e. installing from NuGet results in same binaries as building the source downloaded from this site?
Thanks!
Coordinator
Mar 28, 2013 at 4:18 AM
Yes the source-code on the repository is currently the same as the latest NuGet version.