Skip to content

Destroyed AsyncClient object is still used and causes a crash #17

Description

@BlueAndi

The shown log is in combination with ESPAsyncWebServer, which destroys the AsyncClient always after getting a disconnect indication via callback: https://github.com/me-no-dev/ESPAsyncWebServer/blob/f71e3d427b5be9791a8a2c93cf8079792c3a9a26/src/WebRequest.cpp#L74

The log shows that after _close() the destructor is called. Anyway later the _error() is called, which causes the crash.

[ 37260][E][AsyncTCP.cpp:807] _flushWriteQueue(): socket 51 lwip_write() failed errno=104
AsyncClient(0x3FFE1F38)::_sockIsWriteable: _socket = 51, _conn_state = 4
AsyncClient(0x3FFE1F38)::_close: _socket = 51
AsyncClient(0x3FFE1F38)::~AsyncClient(): _socket = -1
AsyncClient(0x3FFE1F38)::_error: _socket = -1

assert failed: xQueueSemaphoreTake queue.c:1545 (( pxQueue ))


Backtrace:0x40083e39:0x3ffe88600x4008e8d9:0x3ffe8880 0x400941b9:0x3ffe88a0 0x4008f899:0x3ffe89d0 0x401003a4:0x3ffe8a10 0x40100609:0x3ffe8a30 0x401007b7:0x3ffe8a60 0x40100c21:0x3ffe8a90 0x400ffd0b:0x3ffe8b10 

  #0  0x40083e39:0x3ffe8860 in panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
  #1  0x4008e8d9:0x3ffe8880 in esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c:128
  #2  0x400941b9:0x3ffe88a0 in __assert_func at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/assert.c:85
  #3  0x4008f899:0x3ffe89d0 in xQueueSemaphoreTake at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/queue.c:1549 (discriminator 1)
  #4  0x401003a4:0x3ffe8a10 in AsyncClient::_clearWriteQueue() at .pio/libdeps/esp32doit-devkit-v1-usb/AsyncTCPSock/src/AsyncTCP.cpp:1087
  #5  0x40100609:0x3ffe8a30 in AsyncClient::_error(signed char) at .pio/libdeps/esp32doit-devkit-v1-usb/AsyncTCPSock/src/AsyncTCP.cpp:1008
  #6  0x401007b7:0x3ffe8a60 in AsyncClient::_notifyWrittenBuffers(std::deque<AsyncClient::notify_writebuf, std::allocator<AsyncClient::notify_writebuf> >&, int) at .pio/libdeps/esp32doit-devkit-v1-usb/AsyncTCPSock/src/AsyncTCP.cpp:855 (discriminator 1)
  #7  0x40100c21:0x3ffe8a90 in AsyncClient::_sockIsWriteable() at .pio/libdeps/esp32doit-devkit-v1-usb/AsyncTCPSock/src/AsyncTCP.cpp:742
  #8  0x400ffd0b:0x3ffe8b10 in _asynctcpsock_task(void*) at .pio/libdeps/esp32doit-devkit-v1-usb/AsyncTCPSock/src/AsyncTCP.cpp:141

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions