REOPENED 57502
Make malloc validation useful
https://bugs.webkit.org/show_bug.cgi?id=57502
Summary Make malloc validation useful
Oliver Hunt
Reported 2011-03-30 13:33:57 PDT
Make malloc validation useful
Attachments
Patch (21.70 KB, patch)
2011-03-30 13:37 PDT, Oliver Hunt
no flags
Patch (21.73 KB, patch)
2011-03-30 14:53 PDT, Oliver Hunt
no flags
Patch (22.38 KB, patch)
2011-04-04 11:57 PDT, Oliver Hunt
no flags
Patch (23.29 KB, patch)
2011-04-04 12:49 PDT, Oliver Hunt
no flags
Oliver Hunt
Comment 1 2011-03-30 13:37:49 PDT
WebKit Review Bot
Comment 2 2011-03-30 13:42:55 PDT
Attachment 87606 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/wtf/FastMalloc.h:193: Should have a space between // and comment [whitespace/comments] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:169: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:227: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:340: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:1304: pageheap_lock is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:2480: Should have a space between // and comment [whitespace/comments] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:3827: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:3992: One space before end of line comments [whitespace/comments] [5] Total errors found: 8 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3 2011-03-30 14:35:32 PDT
Geoffrey Garen
Comment 4 2011-03-30 14:43:24 PDT
2>..\..\wtf\FastMalloc.cpp(236) : error C2220: warning treated as error - no 'object' file generated 2>..\..\wtf\FastMalloc.cpp(236) : warning C4245: '=' : conversion from '' to 'WTF::Internal::ValidationTag', signed/unsigned mismatch
Geoffrey Garen
Comment 5 2011-03-30 14:49:36 PDT
+ memset(p, 0xCC, header->m_size); I think 0xbbadbeef would be better, since that's that standard dereference we look for to indicate assertion failure. + //if (Internal::fastMallocMatchValidationType(p) != allocType) + // Internal::fastMallocMatchFailed(p); Boo on commented-out code. + //ASSERT(IsHeld(pageheap_lock)); Boo on commented-out code. - ASSERT(IsHeld(pageheap_lock)); + ASSERT(pageheap_lock.IsHeld()); Why all of these changes? r- because of the build failure.
Oliver Hunt
Comment 6 2011-03-30 14:53:03 PDT
(In reply to comment #5) > + memset(p, 0xCC, header->m_size); > > I think 0xbbadbeef would be better, since that's that standard dereference we look for to indicate assertion failure. yeah you'd think memset would be able to plan an entire int given that it takes an int argument, but it converts to unsigned char first. Hence 0xCC. > > + //if (Internal::fastMallocMatchValidationType(p) != allocType) > + // Internal::fastMallocMatchFailed(p); > > Boo on commented-out code. Removed -- it would be nice to add this back, but currently new/free mismatches exist all over the place > > + //ASSERT(IsHeld(pageheap_lock)); > > Boo on commented-out code. Fixed > > - ASSERT(IsHeld(pageheap_lock)); > + ASSERT(pageheap_lock.IsHeld()); > > Why all of these changes? Apparently no one has done a debug build of fast malloc for a long time. > > r- because of the build failure.
Oliver Hunt
Comment 7 2011-03-30 14:53:20 PDT
WebKit Review Bot
Comment 8 2011-03-30 14:55:20 PDT
Attachment 87622 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/wtf/FastMalloc.cpp:169: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:227: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:340: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:1304: pageheap_lock is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:3827: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:3992: One space before end of line comments [whitespace/comments] [5] Total errors found: 6 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 9 2011-03-30 16:12:27 PDT
Geoffrey Garen
Comment 10 2011-04-04 10:37:23 PDT
Comment on attachment 87622 [details] Patch Still failing to build.
Oliver Hunt
Comment 11 2011-04-04 11:57:44 PDT
WebKit Review Bot
Comment 12 2011-04-04 12:01:16 PDT
Attachment 88089 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style']" exit_code: 1 Source/JavaScriptCore/wtf/FastMalloc.cpp:169: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:227: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:340: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:1304: pageheap_lock is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:3827: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:3992: One space before end of line comments [whitespace/comments] [5] Total errors found: 6 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Oliver Hunt
Comment 13 2011-04-04 12:49:26 PDT
WebKit Review Bot
Comment 14 2011-04-04 12:52:40 PDT
Attachment 88103 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style']" exit_code: 1 Source/JavaScriptCore/wtf/FastMalloc.cpp:169: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:227: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:340: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:1306: pageheap_lock is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/wtf/FastMalloc.cpp:3829: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/wtf/FastMalloc.cpp:3994: One space before end of line comments [whitespace/comments] [5] Total errors found: 6 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 15 2011-04-04 13:19:06 PDT
Comment on attachment 88103 [details] Patch r=me, now that the build works and debug builds do not ASSERT.
Oliver Hunt
Comment 16 2011-04-04 15:01:04 PDT
WebKit Review Bot
Comment 17 2011-04-04 15:29:47 PDT
http://trac.webkit.org/changeset/82876 might have broken GTK Linux 32-bit Release
Kent Tamura
Comment 18 2011-04-04 22:42:55 PDT
(In reply to comment #16) > Committed r82876: <http://trac.webkit.org/changeset/82876> I reverted it because of test crashes on the SnowLeopard bot. (Release-only?)
Note You need to log in before you can comment on or make changes to this bug.