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