Skip to content

Increased LWIP main worker thread stack size for debug builds #7194

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
Jun 14, 2018
Merged

Increased LWIP main worker thread stack size for debug builds #7194

merged 1 commit into from
Jun 14, 2018

Conversation

mikaleppanen
Copy link

Description

LWIP stack is configured to be 1200 as default. Without debug enabled,
maximum stack size used for asynchronous DNS operations is 880 bytes. With
debug enabled maximum used stack size is 1248. Added configuration
to LWIP to increase stack size by 25 percent when debug is enabled on build.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@0xc0170 0xc0170 requested a review from a team June 12, 2018 13:25
#define TCPIP_THREAD_STACKSIZE MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2
#elif MBED_DEBUG
// When debug is enabled on the build increase stack 25 percent, thread stack uses 8-byte alignment
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
Copy link
Contributor

Choose a reason for hiding this comment

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

If this alignment is needed here, isn't it potentially needed everywhere? Do they get a loud/clear error if they set something non-aligned in the JSON?

Copy link
Author

@mikaleppanen mikaleppanen Jun 13, 2018

Choose a reason for hiding this comment

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

Loud, maybe not so clear:

[1528872011.15][CONN][RXD] ++ MbedOS Error Info ++
[1528872011.20][CONN][RXD] Error Status: 0x80ff0100 Code: 256 Module: 255
[1528872011.24][CONN][RXD] Error Message: Fatal Run-time error
[1528872011.26][CONN][RXD] Location: 0x12005
[1528872011.27][CONN][RXD] Error Value: 0x0
[1528872011.37][CONN][RXD] Current Thread: Id: 0x2000e8cc Entry: 0x12aad StackSize: 0x1000 StackMem: 0x2000e918 SP: 0x2000f7c0
[1528872011.40][CONN][RXD] -- MbedOS Error Info --
[1528872011.43][CONN][RXD] sys_thread_new create error

We are using the low level rtos api:s which seem to not to protect from this. The standard Thread.cpp would do the align for the behalf the the user.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, so maybe stick the same align macro on all the #if cases just in case while we're here.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I added the macro to all stack size definitions.

LWIP stack is configured to be 1200 as default. Without debug enabled,
maximum stack size used for asynchronous DNS operations is 880 bytes. With
debug enabled maximum used stack size is 1248. Added configuration
to LWIP to increase stack size by 25 percent when debug is enabled on build.
@cmonr
Copy link
Contributor

cmonr commented Jun 13, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 14, 2018

@cmonr cmonr merged commit a588d15 into ARMmbed:master Jun 14, 2018
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.

5 participants