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

esp_ping_new_session does not work together with CONFIG_LWIP_CHECK_THREAD_SAFETY (IDFGH-14183) #14982

Open
3 tasks done
Tarik2142 opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@Tarik2142
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.3 a0f798c

Espressif SoC revision.

ESP32-D0WD-V3 (revision v3.0)

Operating System used.

Windows

How did you build your project?

Other (please specify in More Information)

If you are using Windows, please specify command line type.

CMD

Development Kit.

custom board

Power Supply used.

USB

What is the expected behavior?

esp_ping_new_session starts a new session

What is the actual behavior?

Panic reason: assert failed: netif_get_by_index /IDF/components/lwip/lwip/src/core/netif.c:1706 (Required to lock TCPIP core functionality!)

Steps to reproduce.

select LWIP_TCPIP_CORE_LOCKING
select LWIP_CHECK_THREAD_SAFETY
start new ping session

Debug Logs.

======================== THREADS INFO =========================
#0  0x400835f4 in panic_abort (details=0x3ffe17d4 "assert failed: netif_get_by_index /IDF/components/lwip/lwip/src/core/netif.c:1706 (Required to lock TCPIP core functionality!)") at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c:463
#1  0x4008f1a4 in esp_system_abort (details=0x3ffe17d4 "assert failed: netif_get_by_index /IDF/components/lwip/lwip/src/core/netif.c:1706 (Required to lock TCPIP core functionality!)") at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/esp_system_chip.c:92
#2  0x4009555d in __assert_func (file=<optimized out>, line=<optimized out>, func=<optimized out>, expr=<optimized out>) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/assert.c:80
#3  0x4012943d in netif_get_by_index (idx=<optimized out>) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/netif.c:1706
#4  netif_get_by_index (idx=3 '\003') at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/netif.c:1702
#5  0x4012946c in netif_index_to_name (idx=3 '\003', name=0x3ffe1910 "\004") at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/netif.c:1684
#6  0x4013b72f in esp_ping_new_session (config=0x3ffc483c <wg+20>, cbs=0x3ffc4878 <wg+80>, hdl_out=0x3ffc4888 <wg+96>) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/apps/ping/ping_sock.c:263
#7  0x400d5d6b in WG::pingStart (this=0x3ffc4828 <wg>) at src/wg.h:99
#8  WG::wgTask (args=0x3ffc4828 <wg>) at src/wg.h:229
#9  0x4008ff3d in vPortTaskWrapper (pxCode=0x400d5c98 <WG::wgTask(void*)>, pvParameters=0x3ffc4828 <wg>) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

More Information.

related issue espressif/arduino-esp32#10526

@Tarik2142 Tarik2142 added the Type: Bug bugs in IDF label Dec 5, 2024
@github-actions github-actions bot changed the title esp_ping_new_session does not work together with CONFIG_LWIP_CHECK_THREAD_SAFETY esp_ping_new_session does not work together with CONFIG_LWIP_CHECK_THREAD_SAFETY (IDFGH-14183) Dec 5, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 5, 2024
@david-cermak
Copy link
Collaborator

Hi @Tarik2142

There's a bug in the ping component, it calls potentially unsafe lwip API from the (user/esp_ping_new_session()) calling thread.
I'm attaching a possible fix:

lwip-Fix-ping-session-calling-thread-unsafe-API.path.txt

Thank you for reporting this issue, will fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants