That movie is "Brokedown Palace" with Kate Beckinsale and Claire Danes. It was directed by Jonathan Kaplan and released in 1999. Its title comes from a Grateful Dead song. It's about two girls who are arrested for drug smuggling in Thailand. A cockroach apparently crawled into the ear of Kate's character while the two friends were holed up in a horrendous prison.