Skip to content

SDK v3.4-rc(v3.4) can not work under -DNDEBUG (GIT8266O-652) #1074

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

Open
windowsair opened this issue Apr 5, 2021 · 14 comments
Open

SDK v3.4-rc(v3.4) can not work under -DNDEBUG (GIT8266O-652) #1074

windowsair opened this issue Apr 5, 2021 · 14 comments

Comments

@windowsair
Copy link

Environment

  • IDF version sdk v3.4rc (89a3f25)
  • Operating System: WSL1

Problem Description

If you try to set the Assertion Level to Disabled(-DNDEBUG) in menuconfig, you will get strange error output when generating the bin and terminate as a result.

Expected Behavior

See above

Actual Behavior

See above

Steps to repropduce

  1. Start with any project. Like examples/get-started/hello_world

  2. Change Assertion Level to Disabled
    image

  3. Run idf.py build. Then see Debug Logs

Debug Logs

[589/589] Generating binary image from built executable
FAILED: .bin_timestamp
cd /mnt/g/work/esp8266/sdkV3.4rc/examples/get-started/hello_world/build && /root/.espressif/python_env/rtos3.4_py2.7_env/bin/python /mnt/g/work/esp8266/sdkV3.4rc/components/esptool_py/esptool/esptool.py --chip esp8266 elf2image --flash_mode dio --flash_freq 40m --flash_size 2MB --version=3 -o /mnt/g/work/esp8266/sdkV3.4rc/examples/get-started/hello_world/build/hello-world.bin hello-world.elf && /usr/bin/cmake -E echo "Generated /mnt/g/work/esp8266/sdkV3.4rc/examples/get-started/hello_world/build/hello-world.bin" && /usr/bin/cmake -E md5sum /mnt/g/work/esp8266/sdkV3.4rc/examples/get-started/hello_world/build/hello-world.bin > /mnt/g/work/esp8266/sdkV3.4rc/examples/get-started/hello_world/build/.bin_timestamp
esptool.py v2.4.0
.flash.rodata len 0x02f3c load 0x4021d5c0

A fatal error occurred: Segment loaded at 0x4021d5c0 lands in same 64KB flash mapping as segment loaded at 0x40210010. Can't generate binary. Suggest changing linker script or ELF to merge sections.
@github-actions github-actions bot changed the title SDK v3.4-rc can not work under -DNDEBUG SDK v3.4-rc can not work under -DNDEBUG (GIT8266O-652) Apr 5, 2021
@windowsair
Copy link
Author

Unfortunately, this issue is still present on the v3.4 release....

@windowsair windowsair changed the title SDK v3.4-rc can not work under -DNDEBUG (GIT8266O-652) SDK v3.4-rc(v3.4) can not work under -DNDEBUG (GIT8266O-652) Apr 24, 2021
@q1902505163
Copy link

up ,这个问题解决了吗?我也碰到了

@windowsair
Copy link
Author

up ,这个问题解决了吗?我也碰到了

没有,只能暂时改成别的选项

@q1902505163
Copy link

那你现在是改了什么才能跑起来

@windowsair
Copy link
Author

那你现在是改了什么才能跑起来

看上面的图,只要不用disable就能跑

@q1902505163
Copy link

我这样的话 后面会一直crash。

@windowsair
Copy link
Author

看看core dump,是不是自己代码的问题

@q1902505163
Copy link

好的,谢谢你的回复

@q1902505163
Copy link

up 有联系方式吗?我有问题想要请教

@windowsair
Copy link
Author

我不是乐鑫的fae呀。。有问题你可以直接issue上提

@amakukha
Copy link

I have similar issue when migrating my project from v3.3 to v3.4, even with assertion level disabled.

@lingge
Copy link

lingge commented Jul 27, 2021

我两台电脑,一台可以,一台不行,NND一样的SDK一样的代码。

@mgottschlag
Copy link

I bisected the problem with the following result:

28f466d is the first bad commit
commit 28f466d
Author: donghengqaz [email protected]
Date: Wed Feb 12 10:22:49 2020 +0800

feat(gcc): Update cross toolchain GCC to v8.x

@mgottschlag
Copy link

mgottschlag commented Oct 21, 2022

The following line introduced by the referenced commit is broken because esp_newlib_init() is not executed in NDEBUG builds:

assert(esp_newlib_init() == 0);

EDIT: There are more similar assertions which swallow code in NDEBUG builds. If the functions are called before the assert(), the bug appears to be fixed.

rushire pushed a commit to rushire/ESP8266_RTOS_SDK that referenced this issue Feb 3, 2023
rushire pushed a commit to rushire/ESP8266_RTOS_SDK that referenced this issue Feb 3, 2023
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

No branches or pull requests

5 participants