Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equeue chaining bug fixes #9066

Merged
merged 4 commits into from
Jan 2, 2019
Merged

Conversation

deepikabhavnani
Copy link

Description

Fixes issues reported in #8567

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

CC @geky @marcemmers

deepikabhavnani added 2 commits December 11, 2018 16:24
report error / assert when allocation fails.
Issue was seen with below example
EventQueue q1;
EventQueue q2;

void main() {
while( true ) {
q1.chain( &q2 ); // Chain q2 to q1
q1.chain( NULL ); // Remove chain from q1
//This second step should free the memory from the chained q2 event.
}
}

Memory allocated from q1 slab was freed for q2, which will result in
memory leak.
@cmonr cmonr requested a review from geky December 11, 2018 22:35
@0xc0170 0xc0170 requested a review from a team December 13, 2018 08:46
events/EventQueue.cpp Outdated Show resolved Hide resolved
@deepikabhavnani
Copy link
Author

@ARMmbed/mbed-os-maintainers - API was updated to return error codes. Should be considered for minor release.

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

I'd say this is API change is fine to include in a fix. Doesn't affect ABI, so won't upset any binary blobs using it.

Only things I can imagine it tripping are people inheriting from EventQueue and overriding, or some sort of unit test stub.

events/EventQueue.cpp Outdated Show resolved Hide resolved
@deepikabhavnani
Copy link
Author

I'd say this is API change is fine to include in a fix. Doesn't affect ABI, so won't upset any binary blobs using it.

Patch or minor, will leave the decision to @ARMmbed/mbed-os-maintainers

@cmonr
Copy link
Contributor

cmonr commented Dec 14, 2018

Updated for a patch.

The changing return types are necessary for the fix, and the risk for these updated return types is low.

@deepikabhavnani
Copy link
Author

@geky @SenRamakri - Please review

Copy link
Contributor

@geky geky left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for this

@cmonr
Copy link
Contributor

cmonr commented Dec 27, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 27, 2018

Test run: FAILED

Summary: 1 of 1 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@deepikabhavnani
Copy link
Author

deepikabhavnani commented Dec 27, 2018

jenkins-ci/mbed-os-ci_unittests

Fixed in 14606b5

@cmonr
Copy link
Contributor

cmonr commented Dec 28, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 28, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit ad76c94 into ARMmbed:master Jan 2, 2019
@deepikabhavnani deepikabhavnani deleted the equeue_chain_fixed branch January 3, 2019 19:58
@cmonr cmonr mentioned this pull request Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants