msg.name = "FRED";

shouldn't this be str_cpy(msg.name, "FRED");?