Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 943453002: Avoid wrong memory access due to double substitution and %% (Closed)

Created:
5 years, 10 months ago by Kimmo Kinnunen
Modified:
5 years, 10 months ago
Reviewers:
mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Avoid wrong memory access due to double substitution and %% Use the form SkDebugf("%s", arbitraryString) instead of SkDebugf(arbitraryString). Fixes the case where SkString::appendf-ing a string with "%%" and then printing the string with SkDebugf would cause uninitialized read and corrupted debug print. ninja -C out/Debug tools && valgrind --leak-check=full ./out/Debug/render_pictures --config gpu -w q -r ... ... ==7307== Conditional jump or move depends on uninitialised value(s) ==7307== at 0x6908475: __printf_fp (printf_fp.c:1180) ==7307== by 0x6904267: vfprintf (vfprintf.c:1629) ==7307== by 0x6906E53: buffered_vfprintf (vfprintf.c:2313) ==7307== by 0x690188D: vfprintf (vfprintf.c:1316) ==7307== by 0x67E8F5: SkDebugf(char const*, ...) (SkDebug_stdio.cpp:18) ==7307== by 0x7983F1: GrContext::printCacheStats() const (GrTest.cpp:54) ==7307== by 0x408ECF: tool_main(int, char**) (render_pictures_main.cpp:480) ==7307== by 0x40913E: main (render_pictures_main.cpp:511) ==7307== Budget: 2048 items 100663296 bytes Entry Count: current 652 (651 budgeted, 0 wrapped, 297 locked, 638 scratch 32 0.000000ull), high 652 Entry Bytes: current 51087658 (budgeted 49826658, 49 0.000000ull, 1261000 unbudgeted) high 51087658 (observe "ull" instead of "% full") (from mtklein) This CL is not editing public API. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/297aaf97a32ac16a2bc3f4bbc231d5de859ac02d

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -13 lines) Patch
M include/utils/SkDebugUtils.h View 3 chunks +3 lines, -3 lines 0 comments Download
M src/gpu/GrTest.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLGpu.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/builders/GrGLProgramBuilder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/builders/GrGLShaderStringBuilder.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/PathOpsExtendedTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/PathOpsSkpClipTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/skia_test.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tools/render_pictures_main.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (4 generated)
Kimmo Kinnunen
5 years, 10 months ago (2015-02-19 08:12:12 UTC) #2
mtklein
lgtm
5 years, 10 months ago (2015-02-19 14:22:49 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/943453002/1
5 years, 10 months ago (2015-02-19 14:23:24 UTC) #5
commit-bot: I haz the power
Presubmit check for 943453002-1 failed and returned exit status 1. Running presubmit commit checks ...
5 years, 10 months ago (2015-02-19 14:23:29 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/943453002/1
5 years, 10 months ago (2015-02-19 14:26:24 UTC) #9
commit-bot: I haz the power
5 years, 10 months ago (2015-02-19 14:32:16 UTC) #10
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://skia.googlesource.com/skia/+/297aaf97a32ac16a2bc3f4bbc231d5de859ac02d

Powered by Google App Engine
This is Rietveld 408576698