Skip to content

WiFiClient::flush() crashes due to Load Prohibit since 2.0.12, earlier versions work fine. #8681

Closed
@fredlcore

Description

@fredlcore

Board

ESP32 Olimex EVB and other ESP32 boards

Device Description

None.

Hardware Configuration

Nothing

Version

v2.0.13

IDE Name

Arduino IDE 2.2.1

Operating System

MacOS Sonoma

Flash frequency

80 MHz

PSRAM enabled

yes

Upload speed

115200

Description

This change leads to a Guru meditation due to Load Prohibited when calling client.flush() on a WiFiClient instance:

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400e3847  PS      : 0x00060f30  A0      : 0x800e3950  A1      : 0x3ffb1f50  
A2      : 0x00000000  A3      : 0x3ffbfd38  A4      : 0x00000384  A5      : 0x00000001  
A6      : 0x000000ff  A7      : 0x3f4059d4  A8      : 0x8008fccc  A9      : 0x3ffb1f40  
A10     : 0x00000001  A11     : 0x0002710d  A12     : 0x00027385  A13     : 0x00060f23  
A14     : 0x00060f20  A15     : 0x00000001  SAR     : 0x0000000c  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000010  LBEG    : 0x4008ad85  LEND    : 0x4008ad95  LCOUNT  : 0xfffffff5  
Backtrace: 0x400e3844:0x3ffb1f50 0x400e394d:0x3ffb1f80 0x400dc1fd:0x3ffb1fa0 0x400ee93d:0x3ffb2290
ELF file SHA256: 4726c43adf41a5ad

ESP Stack Trace decoder gives me this:

PC: 0x400e387f: WiFiClientRxBuffer::r_available() at /Users/frederik/Library/Arduino15/packages/esp32/hardware/esp32/2.0.13/libraries/WiFi/src/WiFiClient.cpp line 46
EXCVADDR: 0x00000010

Decoding stack results
0x400e387c: WiFiClientRxBuffer::r_available() at /Users/frederik/Library/Arduino15/packages/esp32/hardware/esp32/2.0.13/libraries/WiFi/src/WiFiClient.cpp line 44
0x400e3985: WiFiClient::flush() at /Users/frederik/Library/Arduino15/packages/esp32/hardware/esp32/2.0.13/libraries/WiFi/src/WiFiClient.cpp line 158
0x400df411: loop() at /Users/frederik/Downloads/BSB-LAN-master/BSB_LAN/BSB_LAN.ino line 7073
0x400ee1f5: loopTask(void*) at /Users/frederik/Library/Arduino15/packages/esp32/hardware/esp32/2.0.13/cores/esp32/main.cpp line 50

The trace narrows the culprit down to line 46:

if(_fd < 0){

If I do a Serial.println(_fd); right before that, the ESP32 crashes.
It seems not to happen all the time, but the reason either seems to be if there are still characters in the incoming client buffer (for lack of a better word) or if there are no more characters coming in.
This problem only occurs in 2.0.12 and 2.0.13, once I revert back to 2.0.11 the problem is gone.
Can you please investigate this further and if possible revert to the state from 2.0.11?
Thank you!

Sketch

client.flush();

Debug Message

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400e3847  PS      : 0x00060f30  A0      : 0x800e3950  A1      : 0x3ffb1f50  
A2      : 0x00000000  A3      : 0x3ffbfd38  A4      : 0x00000384  A5      : 0x00000001  
A6      : 0x000000ff  A7      : 0x3f4059d4  A8      : 0x8008fccc  A9      : 0x3ffb1f40  
A10     : 0x00000001  A11     : 0x0002710d  A12     : 0x00027385  A13     : 0x00060f23  
A14     : 0x00060f20  A15     : 0x00000001  SAR     : 0x0000000c  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000010  LBEG    : 0x4008ad85  LEND    : 0x4008ad95  LCOUNT  : 0xfffffff5  
Backtrace: 0x400e3844:0x3ffb1f50 0x400e394d:0x3ffb1f80 0x400dc1fd:0x3ffb1fa0 0x400ee93d:0x3ffb2290
ELF file SHA256: 4726c43adf41a5ad

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions