Skip to content

Correct check for vtable pointer type (fix Firecracker regression)#279

Merged
adpaco-aws merged 2 commits intomodel-checking:main-153-2021-06-23from
avanhatt:firecracker-regression
Jul 1, 2021
Merged

Correct check for vtable pointer type (fix Firecracker regression)#279
adpaco-aws merged 2 commits intomodel-checking:main-153-2021-06-23from
avanhatt:firecracker-regression

Conversation

@avanhatt
Copy link
Copy Markdown
Contributor

@avanhatt avanhatt commented Jun 30, 2021

Description of changes:

Using is_trait() on a pointee type is an not always a reliable way of checking if a pointer is to a vtable, since it returns false for types with more indirection, such as: &std::sync::Mutex<dyn bus::BusDevice>.

Resolved issues:

Resolves #272

Call-outs:

Same commit on #264, will merge.

Testing:

  • How is this change tested?

Tested on #264.

  • Is this a refactor change?

No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

Copy link
Copy Markdown

@chinmaydd chinmaydd left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@danielsn danielsn left a comment

Choose a reason for hiding this comment

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

LGTM module the comment

} else {
// Assert that the source is not a pointer or is a thin pointer
assert!(pointee_type(src_mir_type).map_or(true, |p| self.use_thin_pointer(p)));
// Check that the source is either not a pointer or some other known case
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what this comment means

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

Copy link
Copy Markdown

@chinmaydd chinmaydd left a comment

Choose a reason for hiding this comment

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

Approved, PR was updated as requested

@adpaco-aws adpaco-aws merged commit 7f0bcb9 into model-checking:main-153-2021-06-23 Jul 1, 2021
adpaco-aws pushed a commit that referenced this pull request Jul 2, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Jul 9, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Jul 15, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Jul 26, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Aug 2, 2021
)

* Correct check for vtable pointer type

* Comment
@zhassan-aws zhassan-aws mentioned this pull request Aug 6, 2021
4 tasks
adpaco-aws pushed a commit that referenced this pull request Aug 6, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Aug 17, 2021
)

* Correct check for vtable pointer type

* Comment
adpaco-aws pushed a commit that referenced this pull request Aug 24, 2021
)

* Correct check for vtable pointer type

* Comment
@avanhatt avanhatt deleted the firecracker-regression branch September 14, 2021 15:25
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 26, 2022
tedinski pushed a commit that referenced this pull request Apr 27, 2022
)

* Correct check for vtable pointer type

* Comment
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.

Firecracker codegen crash: pointee type assertion

4 participants