Skip to content

spirv-fuzz: Check termination instructions when donating modules#3710

Merged
paulthomson merged 2 commits intoKhronosGroup:masterfrom
andreperezmaselco:check-termination-instruction-when-donating-modules
Aug 17, 2020
Merged

spirv-fuzz: Check termination instructions when donating modules#3710
paulthomson merged 2 commits intoKhronosGroup:masterfrom
andreperezmaselco:check-termination-instruction-when-donating-modules

Conversation

@andreperezmaselco
Copy link
Copy Markdown
Collaborator

The FuzzerPassDonateModules was not checking if the function to donate had
a block with OpKill or OpUnreachable as its termination instruction.

Fixes #3709.

Copy link
Copy Markdown
Contributor

@paulthomson paulthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pass/transformation is supposed to support donating live functions with OpKill and OpUnreachable instructions; they are supposed to get replaced with OpReturn or OpReturn val. Did you encounter an assertion failure? If so, I think the bug is elsewhere.

@andreperezmaselco
Copy link
Copy Markdown
Collaborator Author

Yes, it supports donating functions with OpKill and OpUnreachable instructions.
But if such instructions are present, the transformation needs kill_unreachable_return_value_id to use in order to turn these into instructions of the form OpReturnValue %kill_unreachable_return_value_id.

Copy link
Copy Markdown
Contributor

@paulthomson paulthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now! I think we could make it slightly clearer.

@andreperezmaselco andreperezmaselco force-pushed the check-termination-instruction-when-donating-modules branch from 9848d69 to 7948cd3 Compare August 17, 2020 19:03
Copy link
Copy Markdown
Contributor

@paulthomson paulthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@paulthomson paulthomson changed the title spirv-fuzz: Check termination instruction when donating modules spirv-fuzz: Check termination instructions when donating modules Aug 17, 2020
@paulthomson paulthomson merged commit e28436f into KhronosGroup:master Aug 17, 2020
dnovillo pushed a commit to dnovillo/SPIRV-Tools that referenced this pull request Aug 19, 2020
…onosGroup#3710)

The FuzzerPassDonateModules was not checking if the function to donate had
a block with OpKill or OpUnreachable as its termination instruction.

Fixes KhronosGroup#3709.
dneto0 pushed a commit to dneto0/SPIRV-Tools that referenced this pull request Sep 14, 2024
Roll third_party/glslang/ f257e0e..983698b (2 commits)

KhronosGroup/glslang@f257e0e...983698b

$ git log f257e0e..983698b --date=short --no-merges --format='%ad %ae %s'
2020-08-23 john Revert "Merge pull request KhronosGroup#2371 from RafaelMarinheiro/master"
2020-08-21 julius.ikkala Obey ENABLE_PCH CMake option

Created with:
  roll-dep third_party/glslang

Roll third_party/googletest/ adeef1929..1e315c5b1 (14 commits)

google/googletest@adeef19...1e315c5

$ git log adeef1929..1e315c5b1 --date=short --no-merges --format='%ad %ae %s'
2020-08-20 absl-team Googletest export
2020-08-17 absl-team Googletest export
2020-08-12 robert.earhart Export LICENSE
2020-08-03 amatanhead Remove ThrowsMessageHasSubstr and fix some nits after review
2020-07-13 amatanhead Cleanup a bulky expression, document implementation details
2020-07-07 amatanhead Fix build under msvc
2020-07-07 amatanhead Update tests after changing an error message
2020-07-07 amatanhead Fix build under msvc
2020-07-07 amatanhead Add a test to ensure that the `Throws` matcher only invokes its argument once.
2020-07-07 amatanhead Add a test for duplicate catch clauses in throw matchers, fix a couple of nitpicks.
2020-07-03 amatanhead Add missing documentation piece
2020-06-20 amatanhead Small improvements: code style and property name
2020-06-20 amatanhead Add matchers for testing exception properties
2018-05-01 lantw44 Avoid using environ on FreeBSD

Created with:
  roll-dep third_party/googletest

Roll third_party/spirv-cross/ 4c7944bb4..685f86471 (6 commits)

KhronosGroup/SPIRV-Cross@4c7944b...685f864

$ git log 4c7944bb4..685f86471 --date=short --no-merges --format='%ad %ae %s'
2020-08-24 post Run format_all.sh.
2020-08-24 post Work around annoying warning on GCC 10.2.
2020-08-21 post Overhaul how we deal with reserved identifiers.
2020-08-20 post HLSL: Fix FragCoord.w.
2020-08-20 post HLSL: Deal with partially filled 16-byte word in cbuffers.
2020-08-20 post HLSL: Fix bug in is_packing_standard for cbuffer.

Created with:
  roll-dep third_party/spirv-cross

Roll third_party/spirv-tools/ b8de4f5..4dd1223 (9 commits)

KhronosGroup/SPIRV-Tools@b8de4f5...4dd1223

$ git log b8de4f5..4dd1223 --date=short --no-merges --format='%ad %ae %s'
2020-08-21 andreperezmaselco.developer spirv-fuzz: Add words instead of logical operands (KhronosGroup#3728)
2020-08-20 dnovillo CCP should mark IR changed if it created new constants. (KhronosGroup#3732)
2020-08-19 antonikarp spirv-fuzz: add FuzzerPassAddCompositeInserts (KhronosGroup#3606)
2020-08-19 antonikarp spirv-fuzz: Support pointer types in FuzzerPassAddParameters (KhronosGroup#3627)
2020-08-18 jaebaek Let ADCE pass check DebugScope (KhronosGroup#3703)
2020-08-18 andreperezmaselco.developer spirv-opt: Implement opt::Function::HasEarlyReturn function (KhronosGroup#3711)
2020-08-17 andreperezmaselco.developer spirv-fuzz: Check termination instructions when donating modules (KhronosGroup#3710)
2020-08-17 jackoalan Fix -Wrange-loop-analysis warning (KhronosGroup#3712)
2020-08-17 andreperezmaselco.developer spirv-fuzz: Check header dominance when adding dead block (KhronosGroup#3694)

Created with:
  roll-dep third_party/spirv-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spirv-fuzz: FuzzerPassDonateModules does not check termination instructions

2 participants