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

strtol crashes #35176

Closed
aep opened this issue May 11, 2021 · 4 comments · Fixed by #35248
Closed

strtol crashes #35176

aep opened this issue May 11, 2021 · 4 comments · Fixed by #35248
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32 priority: low Low impact/importance bug

Comments

@aep
Copy link

aep commented May 11, 2021

void main(void)
{
   strtol("10",0, 10);
}
[00:00:00.475,000] <err> os:  ** FATAL EXCEPTION
[00:00:00.475,000] <err> os:  ** CPU 0 EXCCAUSE 28 (load prohibited)
[00:00:00.475,000] <err> os:  **  PC 0x4000be94 VADDR (nil)
[00:00:00.475,000] <err> os:  **  PS 0x60a20
[00:00:00.475,000] <err> os:  **    (INTLEVEL:0 EXCM: 0 UM:1 RING:0 WOE:1 OWB:10 CALLINC:2)
[00:00:00.475,000] <err> os:  **  A0 0x80056822  SP 0x3ffe5ca0  A2 0x3f4001e8  A3 0x3ffe5cc0
[00:00:00.475,000] <err> os:  **  A4 0x3ffe5ca0  A5 0x4  A6 0x144  A7 (nil)
[00:00:00.475,000] <err> os:  **  A8 (nil)  A9 0x3ffe5bd0 A10 0x13 A11 0x25
[00:00:00.475,000] <err> os:  ** A12 0x3f400525 A13 0x13 A14 0x3ffe5ca0 A15 0x8
[00:00:00.475,000] <err> os:  ** LBEG 0x400014fd LEND 0x4000150d LCOUNT 0xffffffff
[00:00:00.475,000] <err> os:  ** SAR 0x4
[00:00:00.484,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:00.484,000] <err> os: Current thread: 0x3ffb0cf8 (unknown)
[00:00:00.672,000] <err> os: Halting system


@aep aep added the bug The issue is a bug, or the PR is fixing a bug label May 11, 2021
@galak galak added platform: ESP32 Espressif ESP32 priority: low Low impact/importance bug labels May 11, 2021
@aep
Copy link
Author

aep commented May 11, 2021

this looks like a compiler issue. renaming the function works fine.
possibly it's being replaced with a built-in?

compiler was installed with

aep@stark: ~/zephyrproject/zephyr west espressif install
=== downloading ESP-IDF tools..
Installing tools: xtensa-esp32-elf
Installing [email protected]
Downloading xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz to /home/aep/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz.tmp
Done
Extracting /home/aep/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz to /home/aep/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0
=== downloading ESP-IDF tools completed


@sylvioalves
Copy link
Collaborator

Hi @aep, yes, just comment the L56 below:

-T${CMAKE_CURRENT_SOURCE_DIR}/../components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld

from file
zephyr/modules/hal/espressif/zephyr/CMakeLists.txt

I will submit this soon.

@aep
Copy link
Author

aep commented May 11, 2021

thanks @sylvioalves

that fixed it.

btw is esp32 actually supported? "priority: low" for a fairly base level bug doesnt give me much confidence i should use this at all.

@sylvioalves
Copy link
Collaborator

We have started supporting ESP32 and upcoming Espressif's chips a few months ago. Regarding this specific issue you reported, it was a regression from BT support added recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32 priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants