Can a promising graduate turn into a crank? How should their advisor react? I have noticed from time to time that some PhD students at good, sometimes top, universities (who must have shown promise at some point) start to act as if they're gone a bit crankish.  Say, they speak cryptically about how they are working on [insert famous research problem here, like quantum gravity or the Riemann Hypothesis].

As an advisor, how would you deal with such a student? Clearly there is a risk for the advisor's reputation if this gets out of hand (e.g. the student suddenly posts a patently wrong preprint purporting to solve that famous problem). But how long to wait, and how much efforts to do, before thinking seriously about terminating their contract?
In my opinion, every smart theoretician should take a crack at the major open problems in their field, at least for fun. Often the key to "solving" such problems is to not actually bang your head through the same wall everyone else has been stuck by, but to change the perspective or cheat the problem somehow. Even if you aren't smarter than everyone else, perhaps you can think of an outside-the-box idea others haven't. And as John Conway put it, we aren't as smart as we think we are. If I remember correctly, he said this when interviewed about Fermat's last theorem, which was unsolved at the time. 

Of course if someone actually is "smart" enough to continue in research, they will be able to tell if they have failed. And they will be able to make a rational assessment of risk versus reward in pursuing such a path where the likelihood of funding and career success would be low. Hence pursuing such problems isn't all that different from pursuing other very-high-risk ideas. Just a little farther out on the spectrum.

One situation where this risk-reward assessment breaks down, of course, is mental illness. A manic person might think they are superhuman, for example. And there are some professors that I really wonder about. But mental illness is beyond the scope of sites like this, and I'd note that people with diagnosed illnesses can still function normally (or better) and be very successful in research. 

The short answer is if you can't prove (rigorousy) they will fail, you can't prove they are fools for trying.