|
|
Chromium Code Reviews
DescriptionFix invalid casts from ComplexFeature to SimpleFeature.
UBSan and CFI made the following invalid cast:
../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat
ure')
0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature'
It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there.
BUG=612594, 670404
Committed: https://crrev.com/f37d4947c6fd5ccb4189f2e24a6f0031ee37676d
Cr-Commit-Position: refs/heads/master@{#435713}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Remove debug printf #Patch Set 3 : Remove unnecessary casts #Messages
Total messages: 24 (11 generated)
krasin@chromium.org changed reviewers: + tbarzic@chromium.org
+rdevlin.cronin, who has OWNER powers for this. I think the real issue here is that APIFeature overrides SimpleFeature, even though there are complex API features (e.g. the ones used in web UI) https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... File tools/json_schema_compiler/test/features_generation_unittest.cc (right): https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... tools/json_schema_compiler/test/features_generation_unittest.cc:99: fprintf(stderr, "GetAPIFeature(\"%s\")\n", name.c_str()); remove :) https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... tools/json_schema_compiler/test/features_generation_unittest.cc:292: static_cast<ComplexFeature*>(provider.GetFeature("complex_alias")); I don't think cast is needed if provider.GetFeature is used.
tbarzic@chromium.org changed reviewers: + rdevlin.cronin@chromium.org
adding rdevlin for real
>I think the real issue here is that APIFeature overrides SimpleFeature, even though there are complex API features could be. I have used the code pattern that already exists in the test, but that does not make your statement less true. I would appreciate if the code owners give a hint of what needs to be fixed, as there are at least three bots are broken now due to this: https://build.chromium.org/p/chromium.fyi/builders/UBSanVptr Linux https://build.chromium.org/p/chromium.fyi/builders/CFI Linux Full https://build.chromium.org/p/chromium.fyi/builders/CFI Linux ToT
On 2016/12/01 19:06:23, krasin1 wrote: > >I think the real issue here is that APIFeature overrides SimpleFeature, even > though there are complex API features > > could be. I have used the code pattern that already exists in the test, but that > does not make your statement less true. > I would appreciate if the code owners give a hint of what needs to be fixed, as > there are at least three bots are broken now due to this: > > https://build.chromium.org/p/chromium.fyi/builders/UBSanVptr Linux > https://build.chromium.org/p/chromium.fyi/builders/CFI Linux Full > https://build.chromium.org/p/chromium.fyi/builders/CFI Linux ToT APIFeature overriding SimpleFeature shouldn't be a problem since in non-test code, everything is returned as a Feature* and not cast in any direction. The problem here is that the tests incorrectly cast a complex feature to an API feature, even though GetAPIFeature should only be used for things that we know are of type APIFeature. Naming confusion aside, there shouldn't be a problem beyond fixing the bad casts in the test (which this cl does). LGTM.
On 2016/12/01 19:34:14, Devlin wrote: > On 2016/12/01 19:06:23, krasin1 wrote: > > >I think the real issue here is that APIFeature overrides SimpleFeature, even > > though there are complex API features > > > > could be. I have used the code pattern that already exists in the test, but > that > > does not make your statement less true. > > I would appreciate if the code owners give a hint of what needs to be fixed, > as > > there are at least three bots are broken now due to this: > > > > https://build.chromium.org/p/chromium.fyi/builders/UBSanVptr Linux > > https://build.chromium.org/p/chromium.fyi/builders/CFI Linux Full > > https://build.chromium.org/p/chromium.fyi/builders/CFI Linux ToT > > APIFeature overriding SimpleFeature shouldn't be a problem since in non-test > code, everything is returned as a Feature* and not cast in any direction. The > problem here is that the tests incorrectly cast a complex feature to an API > feature, even though GetAPIFeature should only be used for things that we know > are of type APIFeature. Naming confusion aside, there shouldn't be a problem > beyond fixing the bad casts in the test (which this cl does). > > LGTM. Thank you for the clarification!
The CQ bit was checked by krasin@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594 ========== to ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594,670404 ==========
The CQ bit was unchecked by thakis@chromium.org
thakis@chromium.org changed reviewers: + thakis@chromium.org
(i unchecked cq since this still has the debug printf in it that tbarzic commented on; not sure if you saw his comments. if the plan was to land and then address comments in a follow-up, please re-check cq.)
https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... File tools/json_schema_compiler/test/features_generation_unittest.cc (right): https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... tools/json_schema_compiler/test/features_generation_unittest.cc:99: fprintf(stderr, "GetAPIFeature(\"%s\")\n", name.c_str()); On 2016/12/01 19:02:29, tbarzic wrote: > remove :) Done. https://codereview.chromium.org/2542163002/diff/1/tools/json_schema_compiler/... tools/json_schema_compiler/test/features_generation_unittest.cc:292: static_cast<ComplexFeature*>(provider.GetFeature("complex_alias")); On 2016/12/01 19:02:29, tbarzic wrote: > I don't think cast is needed if provider.GetFeature is used. Done.
On 2016/12/01 19:45:05, Nico wrote: > (i unchecked cq since this still has the debug printf in it that tbarzic > commented on; not sure if you saw his comments. if the plan was to land and then > address comments in a follow-up, please re-check cq.) Thank you, Nico! Somehow I missed the debug printf and tbarzic's comments about this.
The CQ bit was checked by krasin@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rdevlin.cronin@chromium.org Link to the patchset: https://codereview.chromium.org/2542163002/#ps40001 (title: "Remove unnecessary casts")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1480624908149260,
"parent_rev": "d1f0a32d7218f5a2ddc5a6db16e3e46a982a4989", "commit_rev":
"f5895ea0a97d45be1761cc33f7bb872a58a5f472"}
Message was sent while issue was closed.
Description was changed from ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594,670404 ========== to ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594,670404 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594,670404 ========== to ========== Fix invalid casts from ComplexFeature to SimpleFeature. UBSan and CFI made the following invalid cast: ../../tools/json_schema_compiler/test/features_generation_unittest.cc:102:12: runtime error: downcast of address 0x1f55b1c64040 which does not point to an object of type 'APIFeature' (aka 'extensions::SimpleFeat ure') 0x1f55b1c64040: note: object is of type 'extensions::ComplexFeature' It is currently impossible to catch regressions like these with the CQ, but there is a work on getting a UBSan Vptr trybot there. BUG=612594,670404 Committed: https://crrev.com/f37d4947c6fd5ccb4189f2e24a6f0031ee37676d Cr-Commit-Position: refs/heads/master@{#435713} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/f37d4947c6fd5ccb4189f2e24a6f0031ee37676d Cr-Commit-Position: refs/heads/master@{#435713} |
