Project: webrtc Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 1348 Fix size_t to int truncations
Starred by 10 users Project Member Reported by jsc...@chromium.org, Jan 28 2013 Back to list
Status: Available
Owner: ----
Cc:
Components:
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment
These are blocking the Chromium Win64 build as C4327 warnings, so I have a patch disabling the warnings. However, they need to be fixed longterm.
 
Project Member Comment 1 by bugdroid1@chromium.org, Jan 29 2013
The following revision refers to this bug:
    http://code.google.com/p/webrtc/source/detail?r=3423

------------------------------------------------------------------------
r3423 | andrew@webrtc.org | 2013-01-29T06:45:22.290620Z

Changed paths:
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/system_wrappers/source/system_wrappers.gyp&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/common_audio/signal_processing/signal_processing.gypi&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/common_audio/signal_processing/spl_init.c&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/video_engine/video_engine_core.gypi&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_processing/audio_processing.gypi&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/bitrate_controller/bitrate_controller.gypi&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/rtp_rtcp/source/rtp_rtcp.gypi&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/common_video/common_video.gyp&spec=svn3423&r_previous=3422&r=3423&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/media_file/source/media_file.gypi&spec=svn3423&r_previous=3422&r=3423&format=side

Fix webrtc compilation errors for Chrome Win64

Mostly disabling warnings in the gyp files.

BUG=1348
BUG= http://crbug.com/166496 
BUG=http://crbug.com/167187

Review URL: https://webrtc-codereview.appspot.com/1063011
Patch from Justin Schuh <jschuh@chromium.org>.
------------------------------------------------------------------------
Project Member Comment 2 by bugdroid1@chromium.org, Feb 12 2013
The following revision refers to this bug:
    http://code.google.com/p/webrtc/source/detail?r=3464

------------------------------------------------------------------------
r3464 | kjellander@webrtc.org | 2013-02-04T10:07:17.120547Z

Changed paths:
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/video_coding/codecs/vp8/vp8.gyp&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/common_video/common_video.gyp&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_reader_unittest.cc&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_reader.cc&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/voice_engine/test/voice_engine_tests.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_reader.h&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/build/common.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/tools/tools.gyp&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/mock/mock_frame_reader.h&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_coding/neteq4/neteq_tests.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/video_engine/test/auto_test/vie_auto_test.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_writer_unittest.cc&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_writer.cc&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/video_engine/test/libvietest/libvietest.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/frame_writer.h&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/test/testsupport/mock/mock_frame_writer.h&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/system_wrappers/source/system_wrappers.gyp&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_coding/neteq4/neteq.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/.gitignore&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/audio_coding/main/source/audio_coding_module.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/video_coding/main/source/video_coding_test.gypi&spec=svn3464&r_previous=3463&r=3464&format=side
   M http://code.google.com/p/webrtc/source/diff?path=/trunk/webrtc/modules/udp_transport/source/udp_transport.gypi&spec=svn3464&r_previous=3463&r=3464&format=side

Fixing/disabling Windows x64 warnings

Disabled MSVC #4267 warnings in common.gypi to enable x64 builds
for Windows.
Fixed MSVC #4267 warnings in test/testsupport.
Added third_party/directxsdk to .gitignore.

With http://review.webrtc.org/1070008 landed, this should make it possible
to build for x64 on Windows.

BUG=1348
TEST=Compiling with http://review.webrtc.org/1070008 applied:
set GYP_DEFINES="target_arch=x64"
set GYP_GENERATORS=ninja
gclient sync
ninja -C out\Debug_x64

Review URL: https://webrtc-codereview.appspot.com/1060008
------------------------------------------------------------------------
Project Member Comment 3 by kjellander@webrtc.org, Mar 5 2013
Status: Fixed
Marking this as fixed as we're now compiling successfully for x64 on Windows. Most of the work was done in  Issue 1323 .
I realize there are still size_t to int truncations in the code. Please file new issues for any cases where such truncations really needs action.


This bug isn't fixed. All I've done up to this point is suppress the warnings and (in Chrome) add some memory caps to mitigate the risk. The actual bugs in the code still need to be fixed correctly. That's why I filed this bug to track permanent fixes, and why the TODOs in the code point to it.

In the future, please do not close a security-related bug without first consulting with the security team.
Project Member Comment 5 by kjellander@webrtc.org, Mar 5 2013
Owner: niklas.enbom@webrtc.org
Status: Assigned
Sorry for that, I wasn't aware such truncation could be a security issue. 
I suggested creating more fine-grained issues in order to better be able to assign them and get them fixed. 

Niklas: Please decide how to proceed with this in order to get the code fixed. 
We have to do it through the entire Chrome codebase and all dependencies, so it's just a really big project. Right now I have umbrella bugs in the various trackers until I finish standing up the Win64 build. After that we plan to circle back and fix the truncations target by target.
Comment 7 by vrk@webrtc.org, Oct 15 2014
Labels: Area-Build
Project Member Comment 8 by kjellander@webrtc.org, Dec 19 2014
Cc: pbos@webrtc.org
This is making the GN configs ugly, we should consider fixing this (and then maybe someone else than Niklas is a suitable owner?)

Peter, I heard you like grunt work? :)
Project Member Comment 9 by pbos@webrtc.org, Dec 19 2014
Cc: niklas.enbom@webrtc.org stefan@webrtc.org andrew@webrtc.org
Owner: ----
Status: Available
Marking as available and adding a few people. I don't think there's a super-nice way to do it but manually, but I'm wondering whether pkasting@'s work on fixing with our size types helped here. If anyone wants to try just re-enabling this warning in parts of the code, go ahead.
Project Member Comment 10 by bugdroid1@chromium.org, Jan 8 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/external/webrtc.git/+/8649fed1b83882d2f25d3c58a3464a0a59a22225

commit 8649fed1b83882d2f25d3c58a3464a0a59a22225
Author: kjellander@webrtc.org <kjellander@webrtc.org>
Date: Thu Jan 08 21:22:01 2015

GN: Fix Windows build.

This required a tiny include fix in
src/third_party/winsdk_samples/src
which was committed in
https://code.google.com/p/webrtc/source/detail?r=7951

This incorporates contribution from vchigrin@yandex-team.ru
in https://webrtc-codereview.appspot.com/29299004/

BUG=261,1348, 4105 
R=pbos@webrtc.org
TBR=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/32889004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8027 4adac7df-926f-26a2-2b94-8c16560cd09d

[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/DEPS
[add] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/third_party/winsdk_samples/BUILD.gn
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/third_party/winsdk_samples/OWNERS
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/webrtc/modules/audio_coding/BUILD.gn
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/webrtc/modules/rtp_rtcp/BUILD.gn
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/webrtc/modules/video_coding/BUILD.gn
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/webrtc/video_engine/BUILD.gn
[modify] http://crrev.com/8649fed1b83882d2f25d3c58a3464a0a59a22225/webrtc/voice_engine/BUILD.gn

Labels: Hotlist-Recharge-Cold
Status: Untriaged
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue.
The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue.


Project Member Comment 13 by kjellander@webrtc.org, Feb 16
Owner: ehmaldonado@webrtc.org
Status: Assigned
Edward: could you perform a Windows build with the warning removed so we can see how many are still remaining? It'll be easy to do:
1) search-replace all occurances of:
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
in the GN files (e.g. these files: https://cs.chromium.org/search/?q=f:third_party/webrtc+f:gn+no_size_t_to_int_warning&type=cs)

2) build with -k 1000 to make ninja continue even if it hits errors.
3) Save the output to a .txt file and attach it here.
Project Member Comment 14 by ehmaldonado@webrtc.org, Mar 1
Done :)
ninja_log.txt
81.3 KB View Download
Project Member Comment 15 by ehmaldonado@webrtc.org, Jun 19
Status: Untriaged
Project Member Comment 16 by ehmaldonado@webrtc.org, Jun 19
Owner: ----
Project Member Comment 17 by kjellander@webrtc.org, Jun 21 (6 days ago)
Status: Available
Sign in to add a comment