Currently, libpthread only export recvmsg@GLIBC_2.0, not recvmsg@GLIBC_2.24. It seems that dlsym can pick this symbol, and applications can call the function with the wrong struct definition as a result. I suspect a 2.24 version needs to be added to nptl/Versions as well.
As Joseph pointed out, this seems likely BZ#14932. My understanding is libpthread provided old {recv,send}msg only for compatibility reasons, new programs should link against newer one on libc and dlsym should return the new version as well.
Okay, let's treat it as a duplicate. *** This bug has been marked as a duplicate of bug 14932 ***
I think we should fix this bug (in recvmsg) by removing the forwarder in libpthread. The fix for bug 24741 enables that.
Fixed in glibc 2.34 via: commit 0cf67de81650dee7ccd72b43b9405842d3509fbe Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sat Mar 13 20:15:55 2021 -0300 nptl: Remove recvmsg from libpthread The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.