# FindRoot kills kernel

Bug introduced in 7.0 or earlier and fixed in 10.1.0.

I'm having problems with FindRoot killing the kernel. In my real application, I want to FindRoot on a black-box function containing an NDSolve that takes a list of unequal length lists as input and output. The goal is to find limit cycles of a forced system of differential equation. Sometimes it works, but other times it kills the kernel when I run it (beep, then dead kernel, no messages).

The real example is horrible, but here's a minimal example:

f[xs_?(VectorQ[Flatten[#], NumericQ] &)] := {{Sin[xs[[1, 1]]]}};
Do[FindRoot[f[{{x}}] == {{x}}, {x, 0.3}], {1000}]


where the Do loop almost assures failure (Mathematica 10.0.0 on a Mac).

Any idea why or how to fix it? For whatever reason, using a single level list seems OK, so maybe that's the solution.

• Same behavior 9.0 64 bit Windows. Report this to Wolfram support immediately! They are furiously bug patching 10 and if you get the report in quickly enough they might add this to all the other things that kill the kernel and fix them. Wait a little while and you won't see a fix for 18 months or more. – Bill Sep 11 '14 at 5:13
• I confirm it on Linux. When I try 3 evaluations instean of 1000 in the loop the kernels breaks every 4-th evaluation. – ybeltukov Sep 11 '14 at 8:12
• Thanks for the verification -- this has been driving me crazy and it took some work to isolate the problem! I just reported it to Wolfram. – Chris K Sep 11 '14 at 10:47
• Crashes also at 6.0.1 at Windows XP – NicoDean Sep 17 '14 at 22:47

As indicated by Michael E2's edit, this crash has been fixed as of version 10.1.0.

f[xs_?(VectorQ[Flatten[#], NumericQ] &)] := {{Sin[xs[[1, 1]]]}};
Last @ Table[FindRoot[f[{{x}}] == {{x}}, {x, 0.3}], {1000}] // InputForm

(* {x -> 1.9942762963668195*^-8} *)