C# Querying With LINQ Querying the BirdWatcher Data Extension Method

Larry Davis
Larry Davis
5,377 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
177,589 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
5,377 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
177,589 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
5,377 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
177,589 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
5,377 Points

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

Steven Parker
Steven Parker
177,589 Points

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