Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Querying With LINQ Querying the BirdWatcher Data Extension Method

Larry Davis
Larry Davis
6,007 Points

What does this mean? Segmentation fault (core dumped)

When attempting to compile I get this message. I believe my code should compile.

4 Answers

Steven Parker
Steven Parker
231,269 Points

Unless you have discovered a bug in the compiler, this is a message you would get after the code had successfully compiled and when you executed it.

This error means that the program attempted to access some memory space outside of what was allocated to it, as might happen with a bad array index.

For more specific help, make a snapshot of your workspace and post the link to it here.

Larry Davis
Larry Davis
6,007 Points

I don't have this in a workspace; it is part of a challenge in Querying With LINQ course. I was able to get this to compile in LinqPad.

Steven Parker
Steven Parker
231,269 Points

Do you mean compile and run successfully? Good job, if so! Otherwise you could share your code here so we can take a look.

Larry Davis
Larry Davis
6,007 Points

This is my code. It compiles in LinqPad but I have not been able to get it to run.

public static class ContainsAnyExtension { public static bool ContainsAny(this string source, IEnumerable<string> stringsToMatch) { return ContainsAny(source, stringsToMatch); } }

Steven Parker
Steven Parker
231,269 Points

This method seems to call itself unconditionally, which would cause a recursion loop and would certainly explain the error you are seeing.

The instructions say that the method should "use a LINQ query". Replace the recursive call with the LINQ code you write to find the partial matches.

Larry Davis
Larry Davis
6,007 Points

Thank you Steven, I appreciate you looking at this for me.

Steven Parker
Steven Parker
231,269 Points

Larry Davis — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!