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

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

Merged
merged 1 commit into from Oct 15, 2018

Conversation

Projects
None yet
6 participants
@sentinelt
Contributor

sentinelt commented Oct 6, 2018

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
Fix hard-fault when socket created using accept() is closed
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.

@sentinelt sentinelt force-pushed the sentinelt:socket-closed branch from 2d55027 to 9b89ad2 Oct 6, 2018

@cmonr cmonr added the needs: review label Oct 8, 2018

@cmonr cmonr requested review from SeppoTakalo and ARMmbed/mbed-os-connectivity Oct 8, 2018

@0xc0170

0xc0170 approved these changes Oct 9, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Oct 9, 2018

@NirSonnenschein

This comment has been minimized.

Contributor

NirSonnenschein commented Oct 11, 2018

/morph export-build

@NirSonnenschein

This comment has been minimized.

Contributor

NirSonnenschein commented Oct 11, 2018

/morph build

1 similar comment
@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 12, 2018

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 12, 2018

/morph mbed2-build

@cmonr

cmonr approved these changes Oct 12, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 13, 2018

/morph export-build

@cmonr cmonr added rollup PR and removed rollup PR labels Oct 13, 2018

@mbed-ci

This comment has been minimized.

@cmonr cmonr added ready for merge and removed needs: CI labels Oct 13, 2018

@cmonr cmonr merged commit 00f8ecf into ARMmbed:master Oct 15, 2018

15 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 652 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9995 cycles (-202 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the ready for merge label Oct 15, 2018

@sentinelt sentinelt deleted the sentinelt:socket-closed branch Oct 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment