Skip to content

Fix hard-fault when socket created using accept() is closed #8336

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 15, 2018

Conversation

sentinelt
Copy link
Contributor

Description

When socket created using accept() is closed by calling the close()
method, "delete this" is executed which triggers the destructor call
on TCPSocket which in turn calls close() once again. Because _stack
is already 0 this results in a hard-fault.

Add a check that skips the rest of the close() method if the _stack
is already 0.

Tested on NUCLEO-F767ZI. Applies both to master and to release-candidate branches.

Pull request type

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

When socket created  using accept() is closed by calling the close()
method, "delete this" is executed which triggers the destructor call
on TCPSocket which in turn calls close() once again. Because _stack
is already 0 this results in a hard-fault.

Add a check that skips the rest of the close() method is the _stack
is already 0.
@cmonr cmonr requested review from SeppoTakalo and a team October 8, 2018 15:31
@NirSonnenschein
Copy link
Contributor

/morph export-build

@NirSonnenschein
Copy link
Contributor

/morph build

1 similar comment
@cmonr
Copy link
Contributor

cmonr commented Oct 12, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 12, 2018

/morph mbed2-build

@cmonr
Copy link
Contributor

cmonr commented Oct 13, 2018

/morph export-build

@cmonr cmonr added rollup PR and removed rollup PR labels Oct 13, 2018
@mbed-ci
Copy link

mbed-ci commented Oct 13, 2018

@cmonr cmonr merged commit 00f8ecf into ARMmbed:master Oct 15, 2018
@sentinelt sentinelt deleted the socket-closed branch October 30, 2018 23:26
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.

6 participants