Open Bug 1743224 Opened 4 years ago Updated 4 years ago

During link of webrtc, warning: memset used with constant zero length parameter; this could be due to transposed parameters

Categories

(Core :: WebRTC, defect, P5)

x86_64
Linux
defect

Tracking

()

Tracking Status
firefox96 --- affected

People

(Reporter: ishikawa, Unassigned)

Details

For the last couple of weeks (give or take a week or two), I noticed
the following link time warning when I build M-M/C-C thunderbird locally.
I am using gcc-10 under linux64 bit.
There seem to be a few incorrectly written memset calls.

...
       Fresh neqo-http3 v0.5.3 (https://github.com/mozilla/neqo?tag=v0.5.3#ad9439a0)
       Fresh http3server v0.1.1 (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/netwerk/test/http3server)
    Finished dev [optimized + debuginfo] target(s) in 2.58s
gmake[4]: Leaving directory '/NEW-SSD/moz-obj-dir/objdir-tb3/netwerk/test/http3server'
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/NEW-SSD/moz-obj-dir/objdir-tb3/toolkit/library/build/../../../third_party/libwebrtc/call/rtp_sender_gn/Unified_cpp_call_rtp_sender_gn0.o(.debug_addr+0x1d488): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/NEW-SSD/moz-obj-dir/objdir-tb3/toolkit/library/build/../../../third_party/libwebrtc/common_video/generic_frame_descriptor/generic_frame_descriptor_gn/Unified_cpp__frame_descriptor_gn0.o(.debug_addr+0x438): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/NEW-SSD/moz-obj-dir/objdir-tb3/toolkit/library/build/../../../third_party/libwebrtc/modules/video_coding/video_coding_gn/Unified_cpp_video_coding_gn0.o(.debug_addr+0xaea0): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/home/ishikawa/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/NEW-SSD/moz-obj-dir/objdir-tb3/toolkit/library/build/../../../third_party/libwebrtc/modules/video_coding/webrtc_vp8_temporal_layers_gn/screenshare_layers.o(.debug_addr+0x3f38): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/NEW-SSD/moz-obj-dir/objdir-tb3/_virtualenvs/build/bin/python -m mozbuild.action.check_binary --target libxul.so
chmod +x libxul.so
gmake[4]: Leaving directory '/NEW-SSD/moz-obj-dir/objdir-tb3/toolkit/library/build'

I don't know if this false-positive.
But the thing is I had not noticed these warnings. They are rather new.
So it is either M-M code, or possibly new GCC-10 version?

GCC's version is:
gcc-10 --version
gcc-10 (Debian 10.3.0-12) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LD's version is:
ld --version
GNU gold (GNU Binutils for Debian 2.37) 1.16
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

I noticed a similar bugzilla, Bug 581227 a dozen years ago.
Unlike bug 581227, I get Unified_cpp_call_rtp_sender_gn0.o(.debug_addr+0x1d488) and I am not sure which function is to blame.

But ONLY WEBRTC-related binaries are mentioned in the link-time warnings.

I built current tip of moz-central with clang and don't see that warning. I built again with gcc gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 and do see that warning appear, but not related to anything webrtc-related.

I'm going to try a gcc build of moz-central prior to the libwebrtc merge to see if that changes anything.

I don't see any difference building prior to the libwebrtc merge, so I'm going to chalk this up to a difference in gcc-10.

Severity: -- → S4
Priority: -- → P5

For completeness I spun up a Debian 11 VM with gcc (Debian 10.2.1-6) 10.2.1 20210110. I don't see any of those messages when building tip on moz-central.

(In reply to Michael Froman [:mjf] from comment #4)

For completeness I spun up a Debian 11 VM with gcc (Debian 10.2.1-6) 10.2.1 20210110. I don't see any of those messages when building tip on moz-central.

Interesting something must have changed since I submitted the bugzilla.

Let me see if I see this warning with the current M-C/C-C tree.
It's gonna take a day to report this. So hopefully tomorrow night.

You need to log in before you can comment on or make changes to this bug.