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

Move continuation stack from .bss onto sys stack #4622

Merged
merged 3 commits into from
Apr 18, 2018

Conversation

igrr
Copy link
Member

@igrr igrr commented Apr 8, 2018

See #4553.

Allocate continuation stack on the system stack. This is done by overriding the application entry point. Also includes some cleanup in core_esp8266_main.cpp: group extern declarations and global/static variables, move atexit into libc_replacements.c.

Saves 4k in .bss at the expense of extra 4k system stack usage.

@igrr
Copy link
Member Author

igrr commented Apr 8, 2018

Since the amount of available stack space on the system stack is reduced, it would be great if some heavy users of @me-no-dev's *Async libraries could test this.

Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

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

4k that's incredible! happily working for me
Thanks @igrr @earlephilhower @Adam5Wu

@devyte
Copy link
Collaborator

devyte commented Apr 17, 2018

@igrr I don't know if I qualify as a "heavy user" of the Async libs, but I do use AsyncUDP, AsyncTCP, the AsyncWebserver, and an AsyncDNSServer that I wrote myself based on AsyncUDP. My app has been working fine with this for several days.
I suggest merging now to get better exposure. The next step is to implement the stack overflow canary with the hw breakpoint, plus the switching back and forth on context switch. If anything goes wrong with this, the canary will squawk.

@igrr igrr merged commit 5d5ea92 into master Apr 18, 2018
@igrr igrr deleted the feature/cont_stack_on_sys_stack branch April 18, 2018 03:19
@Adam5Wu
Copy link
Contributor

Adam5Wu commented May 27, 2018

I think I may have found a negative impact:
The WPS function is completely broken now.
See: espressif/ESP8266_NONOS_SDK#130

Took me 5 hours and 2 hotspots, before I realized this commit might be related.
And then I test verified: revert to the commit right before, WPS works; after this commit, WPS -> wdt reset.

It kind of make sense, according to the log, some pubkey crypto is involved during WPS, and it probably needed some big chunk of sys stack, which this commit took away...

Although I haven't tested, but it is possible other SDK functions are also broken by this commit, if they need heavy crypto: airkiss? smartconfig? mesh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants