A Stefan-type problem with void formation and its explicit solution