A second man, who killed eight people and wounded 17 others in a stabbing spree, was also executed.