Skip to content

Added missing _mutex->unlock() to FileBase::lookup(). #8451

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

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

korjaa
Copy link
Contributor

@korjaa korjaa commented Oct 17, 2018

Description

My modified Pelion Device Management Client has been getting stuck in the startup for a while now. After days of debugging, I finally was able to pinpoint the system to a mutex deadlock.

I don't thought understand how this has worked with the already released PDMC.

Pull request type

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

@kjbracey-arm, related to the discussion on the hallway, this fix is related to previous modification done in here #7924

@korjaa
Copy link
Contributor Author

korjaa commented Oct 17, 2018

I understood the ScopedLock would be a better way to fix this. If we go with the better fix, please feel free to close this PR.

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 do recall seeing this error during development of #7924.

I corrected it by changing to ScopedLock<PlatformMutex>, but when that was rejected during review, I dropped the commit, forgetting that the commit was actually fixing this mutex bug, not just a style adjustment. Whoops.

You could switch to ScopedLock again, but this is okay.

I think we've not seen a problem because it's a recursive mutex, so wouldn't show any issues until you've got two threads doing file opening (with at least one using /default.)

@kjbracey
Copy link
Contributor

Actually, the ScopedLock version is a bit ugly until #8001, and that was also deferred from #7924, so won't be in until 5.11. This one is fine.

@korjaa
Copy link
Contributor Author

korjaa commented Oct 17, 2018

👍

@cmonr
Copy link
Contributor

cmonr commented Oct 17, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

Build : FAILURE

Build number : 3380
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8451/

@cmonr
Copy link
Contributor

cmonr commented Oct 17, 2018

IAR network license issues.
/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

Build : SUCCESS

Build number : 3387
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8451/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

@cmonr cmonr merged commit 1a6d2f6 into ARMmbed:master Oct 17, 2018
@korjaa korjaa deleted the fix_possible_filebase_deadlock branch October 18, 2018 13:58
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.

4 participants