In older homes, or those that may have settlement issues. the joint where walls meet ceilings can often be anything but straight. I've found that if I try to force crown molding into a wavy environment, I may secure the molding but, more than likely, it will appear twisted or bent. Here's a simple technique that can help get you around that problem.
Cut small triangles from scrap wood, apply some construction adhesive to the back, and set them in a place where you can locate a wall stud. Most homes have a two-by-four running along the top of the wall called a top plate. You can also nail into that. I strongly recommend using a brad nailer for this job -- it's so much easier and faster than
hammer and nail and avoids any wall damage from pounding or missed hammer blows.