This phase I/II trial studies the side effects and best dose of veliparib and topotecan hydrochloride and to see how well they work in treating patients with solid tumors, ovarian cancer that has come back or does not respond to treatment, or primary peritoneal cancer. Veliparib may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Drugs used in chemotherapy, such as topotecan hydrochloride, work in different ways to stop the growth of tumor cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Giving veliparib with chemotherapy may kill more tumor cells.