arch/xtensa/esp32s3: Fix ROM strdup heap issue in USER_HEAP mode#18563
Open
461911662 wants to merge 1 commit intoapache:masterfrom
Open
arch/xtensa/esp32s3: Fix ROM strdup heap issue in USER_HEAP mode#18563461911662 wants to merge 1 commit intoapache:masterfrom
461911662 wants to merge 1 commit intoapache:masterfrom
Conversation
In ESP32-S3 flat build with USER_HEAP mode, ROM strdup internally calls malloc which may be mapped to a different heap than lib_free, causing cross-heap allocation issues and system crashes. This commit adds a new Kconfig option ESP32S3_DONT_USE_ROM_LIBC to allow using NuttX libc instead of ROM newlib functions. When USER_HEAP mode is selected, this option is automatically enabled. Fixes: 60ca804 ("esp32s3: Fix bug related to the PSRAM-allocated task stack") Signed-off-by: 461911662 <461911662@qq.com> Reviewed-by: Tiago Medicci Serrano <tiago.medicci@espressif.com> Reviewed-by: Almir Okato <almir.okato@espressif.com> Reviewed-by: Eren Terzioglu <eren.terzioglu@espressif.com>
cederom
approved these changes
Mar 19, 2026
Contributor
cederom
left a comment
There was a problem hiding this comment.
Thank you @461911662 :-)
Author
|
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
|
linguini1
requested changes
Mar 19, 2026
Contributor
linguini1
left a comment
There was a problem hiding this comment.
Could you please fill out the PR template?
Contributor
This is an automated holiday reply email from QQ Mail. Hello, I am currently on vacation and unable to reply to your email personally. I will reply to you as soon as possible after my vacation ends. |
xiaoxiang781216
approved these changes
Mar 20, 2026
Contributor
|
Hi, We were planning to use Nuttx implementation of Thanks for your work. |
cederom
requested changes
Mar 20, 2026
Contributor
cederom
left a comment
There was a problem hiding this comment.
Just to mark waiting for @eren-terzioglu verification and confirmation :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In ESP32-S3 flat build with USER_HEAP mode, ROM strdup internally calls malloc which may be mapped to a different heap than lib_free, causing cross-heap allocation issues and system crashes.
This commit adds a new Kconfig option ESP32S3_DONT_USE_ROM_LIBC to allow using NuttX libc instead of ROM newlib functions. When USER_HEAP mode is selected, this option is automatically enabled.
Fixes: 60ca804 ("esp32s3: Fix bug related to the PSRAM-allocated task stack")
Reviewed-by: Tiago Medicci Serrano tiago.medicci@espressif.com
Reviewed-by: Almir Okato almir.okato@espressif.com
Reviewed-by: Eren Terzioglu eren.terzioglu@espressif.com
Note: Please adhere to Contributing Guidelines.
Summary
Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.
Impact
Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.
Testing
This section should provide a detailed description of what you did
to verify your changes work and do not break existing code.
Please provide information about your host machine, the board(s) you
tested your changes on, and how you tested. Logs should be included.
For example, when changing something in the core OS functions, you
may want to run the OSTest application to verify that there are no
regressions. Changes to ADC code may warrant running the
adcexample. Adding a new uORB driver may require that you run
uorb_listenerto verify correct operation.Pure documentation changes can just be tested with
make html(see docs) and verification of the correct format in your
browser.
PRs without testing information will not be accepted. We will
request test logs.