Skip to content

Conversation

@shinrich
Copy link
Member

@shinrich shinrich commented Aug 9, 2019

Addressing issue #5807

@shinrich shinrich added the ASan Address Sanitizer label Aug 9, 2019
@shinrich shinrich added this to the 9.0.0 milestone Aug 9, 2019
@shinrich shinrich self-assigned this Aug 9, 2019
@bryancall
Copy link
Contributor

[approve ci autest]

@bryancall
Copy link
Contributor

[approve ci clang-analyzer]

@shinrich shinrich changed the title Address possibe use after free issue in HttpVCTable::remove_entry Address possible use after free issue in HttpVCTable::remove_entry Aug 9, 2019
@bryancall
Copy link
Contributor

This PR reverts some code that was in this PR #4020. Isn't there still going to be issues with events happening on stale state machines?

From #4020:
"This PR cleans up any VIOs against the the HttpSM that is being killed. This ends up preventing inactivity timeouts on stale HttpSM's."

@shinrich
Copy link
Member Author

shinrich commented Aug 9, 2019

Yes, that is why we ran in in production before committing this. There doesn't seem to be a safe way to reach into the netvc at this point in the code. To be safe, any terminating netvc would have to be able to reach into this data structure and null out the relevant pointers.

It seems that we are better off dealing with the stale events by tracking and canceling actions. Since PR #4020 was committed we also made a number of other fixes to track and cancel actions and to better lock and deliver events to the expected thread.

@zwoop zwoop modified the milestones: 9.0.0, 10.0.0 Aug 21, 2019
@zwoop zwoop added the OnDocs This is for PR currently running, or will run, on the Docs ATS server label Sep 24, 2019
@zwoop
Copy link
Contributor

zwoop commented Sep 27, 2019

This does fix the ASAN leak, but as Bryan says, concerning that we might be missing something else that also should have been reverted?

@zwoop
Copy link
Contributor

zwoop commented Oct 1, 2019

What say ye, should we land this?

Comment on lines -197 to -216
if (e->read_vio != nullptr && e->read_vio->cont == sm) {
// Cleanup dangling i/o
if (e == sm->get_ua_entry() && sm->get_ua_txn() != nullptr) {
e->read_vio = sm->get_ua_txn()->do_io_read(nullptr, 0, nullptr);
} else if (e == sm->get_server_entry() && sm->get_server_session()) {
e->read_vio = sm->get_server_session()->do_io_read(nullptr, 0, nullptr);
} else {
ink_release_assert(false);
}
}
if (e->write_vio != nullptr && e->write_vio->cont == sm) {
// Cleanup dangling i/o
if (e == sm->get_ua_entry() && sm->get_ua_txn()) {
e->write_vio = sm->get_ua_txn()->do_io_write(nullptr, 0, nullptr);
} else if (e == sm->get_server_entry() && sm->get_server_session()) {
e->write_vio = sm->get_server_session()->do_io_write(nullptr, 0, nullptr);
} else {
ink_release_assert(false);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is cool, you can do multi-line comments now :).

Copy link
Contributor

@bryancall bryancall left a comment

Choose a reason for hiding this comment

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

A lot more understanding needs to be done with how we are creating and destroying the data structures associated with a transaction. Right now it looks like trial and error with the code changes.

@zwoop zwoop merged commit 996d7da into apache:master Oct 2, 2019
@zwoop
Copy link
Contributor

zwoop commented Oct 2, 2019

Cherry-picked to v9.0.x branch.

@zwoop zwoop modified the milestones: 10.0.0, 9.0.0 Oct 2, 2019
@zwoop zwoop removed the OnDocs This is for PR currently running, or will run, on the Docs ATS server label Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASan Address Sanitizer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants