This bug has been copied from bug #519203 and has been proposed to be backported to 5.4 z-stream (EUS).