Degeneration of Shimura surfaces and a problem in coding theory